The goal of this talk is to introduce the use of tools that simplify the development of packages in R. It’s a free and summarized interpretation of the course prepared by:

The original materials can be found at https://github.com/hadley/pkg-dev

We are going to make a toy package, following this chapter

Setup

All code in these class notes should not be run in the .rmd but in the package environment

install.packages(c(
  "devtools", "roxygen2",
  "testthat", "covr", "pkgdown"
))
usethis::use_course("http://bit.ly/pkg_dev")

Basic Workflow

usethis

The main tool for creating an R-package is usethis, a package that contains a set of functions that simplify the work

We create the package with create_package()

This creates the directory with the basic structure of the package

usethis::create_package('~/Desktop/tstpckg')