Compartmentalized | Documented | Extendible | Reproducible | Robust |
Part 2, Bells and whistles. Checking your package, vignettes, and {pkgdown}.
Just use the RStudio Check in the Build tab. You’ll have many issues (most likely). Plug away at each one until you pass with no errors or warnings. Don’t ignore Notes either. They are sometimes more serious than the errors and warnings.
If R asks you to update packages, and then proceeds to fail at installation because of a warning that a package was built under a later R version than you have on your computer, use
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS=TRUE)
Doing this in RStudio is easy. See rmarkdown vignette chapter and Hadley’s vignette chapter for more info.
Manually
---
fences.Suggests: knitr, rmarkdown
VignetteBuilder: knitr
Or use a helper function:
usethis::use_vignette("plots", title="Plotting")
Open your vignette file and click the Knit button.
pkgdown makes it easy to make nice webpages for your packages.
Once you have a working R package, run this
pkgdown::build_site(override = list(destination = "~/docs"))
docs
folder for the package, pkgdown::build_site()
pkgdown::build_site()
You’ll need to install {pkgdown} if you are on your own computer.
Elements of a NMFS branded package: open this: https://rstudio.cloud/project/3592880
The NMFS Fisheries Integrated Toolbox has a NMFS branded template that you can use: https://github.com/nmfs-fish-tools/pkgdownTemplate
Let’s see an example,
Then type
`pkgdown::build_site(override = list(destination = "~/docs"))`