yDiv Course: Building R packages with Rstudio and GitHub

Date & time: Monday, December 07 – Tuesday, December 08 (2 full days)

Location:

Teachers: Alexander Zizka & Steffen Ehrmann, University of Leipzig and German Centre for Integrative Biodiversity Research

Detailed schedule and locations

Day 1 - 9:30 - 18:00 (remote)

Morning

  1. Hi from Alex and & Steffen
  2. Lectures “Main components of an R-package”
  3. Student project design
  4. “How to build an R package – Tools and workflow”

Afternoon

  1. Demo + exercise 1 “Package skeleton and data”
  2. Demo + exercise 2&3 “Data and Functions”
  3. Demo + exercise 4: “Building and checks”

Day 2 - 9:30 - 18:00 (Grand Canyon, C.02.05)

Morning

  1. Project work
  2. Lecture & exercise “package testing” (Steffen)

Afternoon

  1. Demo Code documentation (Steffen)
  2. Project work
  3. Demo package release (Alex)
  4. Student presentations
  5. Course evaluation and Wrap up

Before the course

Please:

Please do not hesitate to contact us if you have any questions.

Objectives

After this course, students will be able to

  1. understand the structure of R-packages and their main elements
  2. use up-to-date methodology to provide R code and data as R-package
  3. be familiar with common tools for packaging, including roxygen2, devtools, and GitHub

Background

R is a widely used tool for data analyses in ecology. Part of its success is due to the active community and the wide array of add-on packages contributed by scientists from across disciplines, via the CRAN network. R packages are an excellent and standardize way to distribute code and data to a huge community, and a great tool to ensure reproducible research. The course guides through the process of building and R package starting from conceptualization to testing. The course consists of introductory demonstrations coupled with hands-on exercises on the different stages of package building, plus time to work on a small example.

Project Assignment

During the course you will write a small data package based on your own data with guidance from the teachers.

Examination

Grades are pass/fail. Successful participants should participate in all course days and present a project on the last day. A certification will be issued for all participants.

Literature

https://r-pkgs.org/, chapters 2, 6-10 and 16.

Course level and requirements

This is a course for graduate students and researchers that routinely use R for analysis and want to learn how to distribute data and code as R package.

Number of students

max. 10

Language of instruction

English