Chapter 2 Introduction

2.1 Setup

Does everyone have devtools installed?

Check out the devtools cheat sheet: https://rawgit.com/rstudio/cheatsheets/master/package-development.pdf

note that devtools is being split into many pkgs, just be aware https://github.com/r-lib/devtools#conscious-uncoupling

2.2 Why make an R package?

  • the best way to organize code
  • have function documentation
  • have package documentation
  • can have tests
  • allow for namespacing
  • make it easy to wrap compiled code
  • good job skill
  • if on CRAN, make your code useable by others

You’ll be glad you moved your code into a package.