
Thank you R-Ladies Philly for hosting this workshop! Chun Su kindly created the thumbnail image for this workshop, as well as provided feedback on this post and the workshop content (thank you for so generously sharing your time!).Updated Mawith info on the reactablefmtr and gtextras packages. Usethis::use_git(), usethis::use_github()Īlthough not explicitly written in these steps, I also recommend restarting R frequently in the development process ( Session -> Restart R or Ctrl + Shift + F10) in order to test your package in a clean environment. Here is a recap of our steps, although your work flow may differ. I hope you feel empowered to start developing your own packages now! We went through many of these steps one time only however, in the development process, some of these steps are iterative. (This name is inspired by R- Ladies Philly.)Ĭompute_corr(data = faithful, var1 = eruptions, var2 = waiting) Here, I am creating a package named ralph on my desktop. Open an R session and submit the following, modified to your desired location. How to develop good R packages by Maëlle Salmon R packages book by Hadley Wickham and Jenny Bryan This table only contains functions used in this workshop there are many other handy functions in devtools and usethis for package development. Single usage functions only need to be used one time in the development process multiple usage functions are executed as needed. Please install and update all software / packages prior to following along, as otherwise errors may arise. This material was developed using: Software / package DisclaimerĪrtwork adapted from have learned enough about package development to share with you what has worked well for me however, I am still learning! Comments and suggestions are welcome. Familiarity with pipe or tidyverse is helpful. Attendees should be familiar with functions, but will not be writing their own function in this workshop. This workshop is suitable for beginner to intermediate R users.

At the end of the hour you should have a working, well-documented package with a single function, as well as a better understanding of the files and file structure required for R packages.


The workshop will cover handy one time functions (i.e., usethis::create_package) as well as functions used continuously throughout package development (i.e., devtools::document).

This workshop is for people looking to learn how to make their own R packages and learn how to use usethis and devtools for package development. This post was updated on with the YouTube workshop recording. We demonstrate how leveraging the devtools and usethis packages in package development can automate folder structure and file creation, speeding up the development process. This blog post accompanies the R-Ladies Philly workshop on November 12, 2020.
