process_pkg | R Documentation |
Executes all steps to process an R package written in R Markdown format from source to installation in one go:
Purl all relevant Rmd/*.Rmd
files to R/*.gen.R
files using purl_rmd()
.
Re-generate the pkgdown reference index based on the package's main R Markdown file using gen_pkgdown_ref()
(if gen_pkgdown_ref = TRUE
).
Re-build the package documentation using devtools::document()
(if document = TRUE
).
Build and install the package (if build_and_install = TRUE
). This is done either using
rstudioapi::executeCommand(commandId = "buildFull")
(if use_rstudio_api = TRUE
) or using devtools::install()
(if
use_rstudio_api = FALSE
).
Restarts the R session using rstudioapi::restartSession()
(if either restart_r_session = TRUE
or use_rstudio_api = TRUE
).
process_pkg(
path = ".",
add_copyright_notice = funky::config_val("add_copyright_notice"),
add_license_notice = funky::config_val("add_license_notice"),
gen_pkgdown_ref = funky::config_val("gen_pkgdown_ref"),
env = parent.frame(),
document = TRUE,
build_and_install = TRUE,
restart_r_session = build_and_install,
use_rstudio_api = NULL,
quiet = TRUE,
roclets = NULL,
args = getOption("devtools.install.args"),
dependencies = NA,
upgrade = "never",
keep_source = getOption("keep.source.pkgs")
)
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 |
add_license_notice |
Whether or not to add a license notice at the beginning of the generated |
gen_pkgdown_ref |
Whether or not to overwrite pkgdown's reference index in the configuration file |
env |
Environment to evaluate R Markdown inline code expressions in when generating the pkgdown reference index. Only relevant if
|
document |
Whether or not to re-build the package documentation after purling |
build_and_install |
Whether or not to build and install the package after purling |
restart_r_session |
Whether or not to restart the R session. Highly recommended if |
use_rstudio_api |
Whether or not to rely on the RStudio API to install the built package (which always triggers an R session restart regardless of
|
quiet |
Whether or not to suppress printing status output from internal processing. |
roclets |
Character vector of roclet names to use with package.
The default, |
args |
An optional character vector of additional command line
arguments to be passed to |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
keep_source |
If |
Note that the installation via devtools::install()
(i.e. use_rstudio_api = FALSE
) is known to fail in certain situations (lazy-load database corruption)
due to unresolved deficiencies in R's namespace unloading. If you encounter an error, simply restart the
R session and try again.
This function is registered as an RStudio add-in, allowing RStudio users to assign a custom shortcut to it and to invoke it from the command palette.
path
, invisibly.
Other high-level functions:
lint_rmd()
,
load_pkg()
,
purl_rmd()
,
run_nopurl_rmd()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.