Skip to content

Instantly share code, notes, and snippets.

@knbknb
Created April 5, 2020 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knbknb/cbac73ab02bcc0edf7b9e0eeccd22c36 to your computer and use it in GitHub Desktop.
Save knbknb/cbac73ab02bcc0edf7b9e0eeccd22c36 to your computer and use it in GitHub Desktop.
R package creation scaffold accoding to Bob Rudis
# Writing Frictionless R Package Wrappers — Building A Basic R Package
# https://rud.is/b/2020/01/03/writing-frictionless-r-package-wrappers-building-a-basic-r-package/#fnref-12609-2
# in any RStudio R Console session
devtools::create("~/packages/THE-PACKAGE-NAME")
# in the newly created package RStudio R Console session:
usethis::use_mit_license() # need a LICENSE file
usethis::use_roxygen_md() # use {roxygen2} for documentation and configuration
usethis::use_package_doc() # setup a package-level manual page
usethis::use_testthat() # setup testing infrastructure
usethis::use_test("placeholder") # setup a placeholder test file
devtools::document() # Let {roxygen2} create NAMESPACE entries, build manual pages (and, more later on)
devtools::check() # looking for the three "0's" that tell us we're ready to roll!
usethis::use_git() # put the directory under git version control
usethis::git_vaccinate() # Prevent leaking credentials and other unnecessary filesystem cruft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment