Skip to contents

Predefined litr templates make it easy to get started writing R packages of various kinds. The following table shows the package templates available. Click on the “Generated html” and “Generated R package” cells to see what each template produces.

Template name Description Rmd source file Generated html Generated R package
make-an-r-package the most basic package: a function and a test create-rhello.Rmd create-rhello.html rhello/
make-an-r-package-with-data a package with a data set in it create-rhasdata.Rmd create-rhasdata.html rhasdata/
make-an-r-package-with-rcpp a package using Rcpp create-withrcpp.Rmd create-withrcpp.html withrcpp/
make-an-r-package-with-extras a package with a README, vignette(s), a pkgdown site, and a hex sticker create-withpkgdown.Rmd create-withpkgdown.html withpkgdown/
make-an-r-package-from-bookdown a package defined in a bookdown index.Rmd, 1description.Rmd, etc. _book/index.html frombookdown/
make-an-r-package-with-armadillo a package using RcppArmadillo create-witharmadillo.Rmd create-witharmadillo.html witharmadillo/

Once you’ve chosen a template, you can get started as follows:

                 template = "[name-of-template]",
                 package = "litr")

Here, "[name-of-template]" would be chosen from the first column of the table above. For example, for the most basic template, you would do the following:

                 template = "make-an-r-package",
                 package = "litr")

And to make an R package that uses Rcpp, you would start with the following:

                 template = "make-an-r-package-with-rcpp",
                 package = "litr")