Tools for analyzing gaps in ocean acidification data
library(devtools)
devtools::setup()
git config --global user.email clthomas07@gmail.com
git commit --amend --reset-author
One time install:
devtools::install_github("resilienseas/oatools")
Load package:
library(oatools)
devtools::use_package("rgdal", type="Imports")
devtools::use_package("sp", type="Imports")
devtools::use_package("raster", type="Imports")
devtools::use_package("sdmpredictors", type="Imports")
devtools::use_package("leaflet", type="Suggests")
Update documentation after adding or modifying a function in tools.R
. Note: Placing cursor in functino and using menu "Code" -> "Insert Roxygen Skeleton" is very handy for automatically populating the function documentation, including any new arguments added.
devtools::document()
traceback()
: get details on error messagesystem.file(package="oatools")
: find out path for installed R packagedevtools::load_all(here("../oatools"))
, then browser()
to debug inside functionTo 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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.