Skip to content

Instantly share code, notes, and snippets.

@wiesehahn
Last active July 16, 2024 06:58
Show Gist options
  • Save wiesehahn/178b3e5553e730de95d526e8f12747c6 to your computer and use it in GitHub Desktop.
Save wiesehahn/178b3e5553e730de95d526e8f12747c6 to your computer and use it in GitHub Desktop.
R package development notes

R package development Cheat Sheet

https://raw.githubusercontent.com/rstudio/cheatsheets/main/package-development.pdf

# create package 
create_package("path/to/name")
# create file for code
use_r("name")
# load functions for testing
load_all()
# create DOCUMENTATION from roxygen comments
use_package_doc()
document()
# create and build README
use_readme_rmd()
use_news_md()
devtools::build_readme()
# get GIT info
git_sitrep()
# create and build vignette
usethis::use_vignette("how-to-use-the-functions")
devtools::build_vignettes()
# automatically sort DESCRIPTION
usethis::use_tidy_description()
# add packages to DESCRIPTION
use_package("sf")
# CHECK complete package
check()
# for local binary
devtools::build()
install.packages(path_to_file, repos = NULL, type="source")
# configue GH Pages
use_pkgdown_github_pages()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment