

You are going to create a directory with the bare minimum folders of R packages. I am having you download the development version of the roxygen2 package.ĭevtools::install_github("klutometis/roxygen") The packages you will need to create a package are devtools and roxygen2. (For more details, I recommend this chapter in Hadley Wickham’s Advanced R Programming book.) this is my attitude about all reproducibility.) This tutorial is about creating a bare-minimum R package so that you don’t have to keep thinking to yourself, “I really should just make an R package with these functions so I don’t have to keep copy/pasting them like a goddamn luddite.” Seriously, it doesn’t have to be about sharing your code (although that is an added benefit!). This tutorial is not about making a beautiful, perfect R package. I wish I could go back in time and create the package the first moment I thought about it, and then use all the saved time to watch cat videos because that really would have been more productive.


I sat down yesterday as part of Etsy’s hack week and decided “I am finally going to make that package I keep saying I am going to make.” It took me such little time that I was hit with that familiar feeling of the joy of optimization combined with the regret of past inefficiencies (joygret?). Until…Įtsy has an amazing week called “ hack week” where we all get the opportunity to work on fun projects instead of our regular jobs. I have been a fan of the idea of personal R packages for a while, but it always seemed like A Project That I Should Do Someday and someday never came. Because of the nature of iterative development, it often happens that I reuse the functions many times, mostly through the shameful method of copying the functions into the project directory. As I have worked on various projects at Etsy, I have accumulated a suite of functions that help me quickly produce tables and charts that I find useful.
