National Park Service tools for R
devtools::install_github("ecoquants/npstools")
Will include basic usage of functions here later. For now, see:
Below are some notes about the creation and maintenance of this R package.
devtools::create(path=".")
to initiate a package. You can say "no" when it asks you to overwrite the RProj file.For more, see https://github.com/isteves/r-pkg-intro.
To update the website for the R package, update documentation and regenerate the website outputs into the docs/
folder:
devtools::document()
pkgdown::build_site()
pkgdown::build_site()
You may get error like this...
Reading 'man/find_gaps.Rd'
Error in rep(TRUE, length(x) - 1) : invalid 'times' argument
To fix this, be sure that all arguments in your functions are given a definition, ie next to #' @param some-argument-name
. Then in RStudio, place your cursor inside the offending function (eg find_gaps()
based on error message example), Code > Insert Roxygen Skeleton. This assures all arguments are listed in the documentation of the function. Then rerun:
devtools::document()
pkgdown::build_site()
See: Dependencies in Package basics ยท R packages http://r-pkgs.had.co.nz/description.html#dependencies
devtools::use_package("tidyverse" , type="Imports")
devtools::use_package("lubridate" , type="Imports")
devtools::use_package("fs" , type="Imports")
devtools::use_package("here" , type="Imports")
devtools::use_package("glue" , type="Imports")
devtools::use_package("yaml" , type="Imports")
devtools::use_package("openxlsx" , type="Imports")
devtools::use_package("pivottabler", type="Imports")
devtools::use_package("leaflet" , type="Imports")
devtools::use_vignette("quick-start")
devtools::document()
pkgdown::build_site()
# setup data-raw/ folder
devtools::use_data_raw()
# populate from local
devtools::use_data(applicants, overwrite = TRUE)
Copied Visual Basic (VB) modules in Access database to install folder inst/accessdb_source/*.vb
for translating from strings to pseudo-SQL into inst/accessdb_source/*.sql
and indent for readability to then translate into dplyr functions for R (see cheat sheet Data Transformation with dplyr).
Used three panes:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.