Liza Wood: Package creation using roxygen2
Liza shows us how to create an R package and write its documentation using Roxygen2
Live Code from presentation as separate script
Liza’s script shows how to make an R package for your favorite function(s) and distribute it via Github. The process, in brief:
- Use the
devtools
package to create a blank project directory from a template. - Put each function into a script in the
R
folder of the project directory. - Decorate each function script with
roxygen2
-style documentation. - Run the
devtools::document()
function to generate the package documentation. - Fill in the template
DESCRIPTION
file - Create a Github repository and push the package to it.
Now anyone can load your package directly from Github and use the R functions you’ve created!