This is a kind of checklist that I use to build consistent package infrastructure with the usethis package.
library(usethis)
# I use templates from fgeo.template. I must have it installed but not loaded.
# install.packages("fgeo.template")
Global options
use_usethis()
use_description()
use_blank_slate()
Once per package
# create_package("PACKAGE-PATH-ENDING-WITH-PACKAGE-NAME")
Work mostly on DESCRIPTION
# In DESCRIPTION, Manually edit the fields Title and Description.
# Manually edit the field Authors@R -- but see use_description()
# I use this snippet https://i.imgur.com/2YRijFP.png
# * Learn about RStudio snippets: http://bit.ly/2uOPh4a
?licenses
# I frequently use
# use_gpl3_license()
use_roxygen_md()
use_git()
use_github("OWNER-GOES-HERE")
# I use
# use_github("forestgeo")
# Confirm
browse_github()
# Not necessary if you run `use_github()` before
use_github_links()
use_dev_version()
use_tidy_description()
Git may be able to push yet not create a permanent link with your remote origin. You can create such link from the terminal.
# Link origin and master
git push -u origin master
# Next time this will be enough
git pull
git push
Work on other important documentation
use_package_doc()
# Effect on README
use_readme_rmd()
# TODO: Edit output file to customize for your package
# I use
# use_template(template = "README.Rmd", package = "fgeo.template")
# Knit to create README.md
# Lifecycle stages according to https://www.tidyverse.org/lifecycle/
use_lifecycle_badge("experimental")
use_cran_badge()
use_tidy_coc()
use_news_md()
# GitHub ------------------------------------------------------------------
# Docs
use_tidy_contributing()
# TODO: Edit output file to customize for your package
# I use
# use_template(template = "CONTRIBUTING.md", package = "fgeo.template")
use_tidy_issue_template()
# TODO: Move to .github/
# I use
# use_template(template = "ISSUE_TEMPLATE.md", package = "fgeo.template")
use_tidy_support()
# TODO: Edit output file to customize for your package
# TODO: Move to .github/
# I use
# use_template(template = "SUPPORT.md", package = "fgeo.template")
# Labels
use_github_labels(delete_default = TRUE)
# Apps
# Install a stale-probot at https://probot.github.io/apps/stale/
# TODO: Move to .github/stale.yml
# I use
# use_template(template = "stale.yml", package = "fgeo.template")
# Install todo at https://github.com/apps/todo
# TODO: Move to .github/config.yml
# I use
# use_template(template = "config.yml", package = "fgeo.template")
Almost always
# Services ----------------------------------------------------------------
use_testthat()
use_coverage()
# I use
# use_coverage("coveralls")
use_travis()
# Or
use_tidy_ci(browse = interactive())
use_pkgdown()
# TODO: If necessary, edit _pkgdown.yml
# I use
# use_template(template = "_pkgdown.yml", package = "fgeo.template")
# Tidyverse ---------------------------------------------------------------
use_pipe()
use_tidy_eval()
As required during development
# Relatively frequently ---------------------------------------------------
use_r()
use_test()
use_build_ignore("FILE-NAME-GOES-HERE")
use_git_ignore("FILE-NAME-GOES-HERE")
use_package("NAME-OF-PACKAGE-TO-USE")
use_dev_package("NAME-OF-PACKAGE-TO-USE")
use_data(DATASET-PLOT-OR-WHATEVER-OBJECT-GOES-HERE)
use_data_raw()
# Less frequent -----------------------------------------------------------
use_vignette()
# If necessary, set (build)ignore to TRUE.
use_directory("PATH-GOES-HERE", ignore = FALSE)
# I commonly use
# use_directory("inst")
use_tidy_description()
use_dev_version()
use_tidy_versions(overwrite = FALSE)
use_tidy_style()
use_version()
Rare but good to know
Create an rmarkdown template in your package that will be available when users install your package.
use_rmarkdown_template(
"TEMPLATE-NAME-GOES-HERE.Rmd",
template_description = "DESCRIPTION GOES HERE"
)
# TODO: Fill your template. It lives here:
# "inst/rmarkdown/templates/TEMPLATE-NAME-GOES-HERE/skeleton/skeleton.Rmd"
Once users install your package, your template will be available in the templates’ list.