Chapter 1 Workshop Agenda

  1. Package setup
  2. Running checks on package
  3. Version Control
  4. Package documentation
  5. Building package
  6. Adding Test to the package
  7. Writing vignettes

1.1 Useful resources

1.2 Prerequisites

We need to make sure we have the following packages installed:

install.packages(c("devtools", "roxygen2","usethis", "testthat"))

We will use devtools package to create an appropriate package structure and perform frequent development tasks, like building, installing, and loading the package, checking and updating its documentation, run examples and tests.

Devtools package contains the following core functions:

  • create()
  • document()
  • check()
  • build()
  • test()

R package roxygen2 will help us to add manuals and examples to our package.

Finally the testthat package provides functions that make it easy to describe what you expect the function to do, inclusing catching errors, warnings, and messages.