Useful links for making an R package
R Package Resources
-
Releasing to CRAN chapter from Wickham/Bryan book, but most useful is to just run
usethis::use_release_issue()
to initiate a GitHub issue with a checklist of to-do items for a CRAN release.
Random Notes
-
To rebuild the package after making changes:
devtools::document()
-
Update packages listed in Imports in the DESCRIPTION file with the most recent version number:
usethis::use_latest_dependencies(overwrite = TRUE, source = "CRAN")
-
To propogate imported packages in the NAMESPACE auto-generated file, I created a
R/<em>package name</em>-package.R
file that includes the necessary packages with@imports <em>package</em>
lines. See, e.g. here. -
To be accepted by CRAN, your package must have 0 errors and 0 warnings. Notes are discouraged.
-
Line to build and check package locally before CRAN submission
R CMD build . && R CMD check $(ls -t . | head -n1) --as-cran