Executes the steps to load an R package written in R Markdown format in one go:
Purl all relevant
Rmd/*.Rmd
files toR/*.gen.R
files usingpurl_rmd()
.Loads the package using
devtools::load_all()
.
Usage
load_pkg(
path = ".",
add_copyright_notice = FALSE,
add_license_notice = FALSE,
gen_pkgdown_ref = FALSE,
reset = TRUE,
recompile = FALSE,
export_all = TRUE,
helpers = TRUE,
quiet = FALSE,
...
)
Arguments
- path
Path to the root of the package directory.
- add_copyright_notice
Whether or not to add a copyright notice at the beginning of the generated
.R
files as recommended by e.g. the GNU licenses. The notice consists of the name and description of the program and the wordCopyright (C)
followed by the release years and the name(s) of the copyright holder(s), or if not specified, the author(s). The year is always the current year. All the other information is extracted from the package'sDESCRIPTION
file. A logical scalar. Only applies ifpath
is actually an R package directory.- add_license_notice
Whether or not to add a license notice at the beginning of the generated
.R
files as recommended by e.g. the GNU licenses. The license is determined from the package'sDESCRIPTION
file and currently only theAGPL-3.0-or-later
license is supported. A logical scalar. Only applies ifpath
is actually an R package directory.- gen_pkgdown_ref
Whether or not to overwrite pkgdown's reference index in the configuration file
_pkgdown.yml
with an auto-generated one based on the main input file as described ingen_pkgdown_ref()
. A logical scalar. Only applies ifpath
is actually an R package directory, pkgdown is set up and a main R Markdown file exists.- reset
clear package environment and reset file cache before loading any pieces of the package. This largely equivalent to running
unload()
, however the old namespaces are not completely removed and no.onUnload()
hooks are called. Usereset = FALSE
may be faster for large code bases, but is a significantly less accurate approximation.- recompile
DEPRECATED. force a recompile of DLL from source code, if present. This is equivalent to running
pkgbuild::clean_dll()
beforeload_all
- export_all
If
TRUE
(the default), export all objects. IfFALSE
, export only the objects that are listed as exports in the NAMESPACE file.- helpers
if
TRUE
loads testthat test helpers.- quiet
if
TRUE
suppresses output from this function.- ...
Additional arguments passed to
pkgload::load_all()
.
See also
Other high-level functions:
lint_rmd()
,
process_pkg()
,
purl_rmd()
,
run_nopurl_rmd()