Writing R packages

How to write R packages that make life easier for you yourself and for others

Sophie Curtis-Ham https://www.researchgate.net/profile/Sophie-Curtis-Ham
06-09-2022

R packages are collections of functions and datasets that extend the base functionality of R. You are already familar with them because whenever you type, for example, library(dplyr) in your R script you are using a package `dplyr’ and its functions. In this workshop Sophie Curtis-Ham will demonstrate how you yourself can create R packages.

Note that the workshop is in the morning: 10:00-11:00. Join this workshop meeting on Zoom by clicking this link

Sophie Curtis-Ham, PhD, is Senior Research and Insights Advisor at the New Zealand police. She is the author of the R package gpsmartr, a tool for supporting geographic offender profiling.

Materials

The slides that Sophie uses in the workshop.

Sophie uses a couple of R packages in the workshop:

To reproduce the examples, you need to have installed a couple of packages (devtools, usethis, tidyverse, rlang, broom, here). To install them all, run: install.packages(c("devtools","usethis", "tidyverse", "rlang", "broom", "here"))

Citation

For attribution, please cite this work as

Curtis-Ham (2022, June 9). NSC-R Workshops: Writing R packages. Retrieved from https://nscrweb.netlify.app/posts/2022-06-09-writing-r-packages/

BibTeX citation

@misc{curtis-ham2022writing,
  author = {Curtis-Ham, Sophie},
  title = {NSC-R Workshops: Writing R packages},
  url = {https://nscrweb.netlify.app/posts/2022-06-09-writing-r-packages/},
  year = {2022}
}