Learn to write unit tests in R with the testthat package, from basic assertions to fixtures and skipping tests.
Tutorial series
R Package Development
7 tutorials — follow in order for the best learning path.
- Testing with testthat
- Writing Vignettes in R
Learn how to write package vignettes in R, the narrative articles that walk users through real-world workflows and explain how your package fits together.
- Submitting to CRAN, Learn how to package, document, check, and
Learn how to package, document, check, and submit your R package to CRAN, with practical advice on responding to reviewer feedback.
- R Package Structure, The files, directories, and conventions
The files, directories, and conventions that define an R package, from DESCRIPTION to vignettes. Every R package follows a fixed directory layout.
- DESCRIPTION and NAMESPACE Files
Learn what DESCRIPTION and NAMESPACE files do in an R package, the manifest and namespace contract every package needs.
- Documenting with roxygen2
Write roxygen comments in your R source files to auto-generate Rd documentation for your package functions with devtools::document().
- Building Documentation Websites with pkgdown in R
Guide to building documentation websites for R packages with pkgdown: installation, _pkgdown.yml config, navbar, articles, reference index, and deployment.