© Matt Wiley and Joshua F. Wiley 2016

Matt Wiley and Joshua F. Wiley, Advanced R, 10.1007/978-1-4842-2077-1_6

6. Writing a Package

Matt Wiley and Joshua F. Wiley1

(1)Elkhart Group Ltd. & Victoria College, Columbia City, Indiana, USA

Packages are the fundamental way to document, share, and distribute R code and data. Our goal is to write our own packages, and our fair warning is that this chapter is particularly complex because of the many software tools that are employed during R package development.

In this chapter, we make sure of four packages. The devtools package (Wickham and Chang, 2016) provides functions to help set up, document, and manage the development of an R package. The roxygen2 package (Wickham, Danenberg, and Eugster, 2015) greatly ...

Get Advanced R: Data Programming and the Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.