r_cmd_call: _(EXPERIMENTAL)_ Performs a tweaked 'R CMD' call

Description Usage Arguments Value Installation The renviron feature

View source: R/r_cmd_call.R

Description

(EXPERIMENTAL) Performs a tweaked 'R CMD' call

Usage

1
2
3
4
5
6
7
8
r_cmd_call(
  extras = c("debug", "as", "config", "renviron", "eval"),
  args = commandArgs(trailingOnly = TRUE),
  unload = TRUE,
  debug = NA,
  envir = parent.frame(),
  dryrun = FALSE
)

Arguments

extras

(character vector) Additional features that should be injected to R CMD.

args

(optional) Command-line arguments after the --args option

unload

If TRUE, then the package is unloaded afterward, otherwise not.

debug

If TRUE, debug information is outputted, otherwise not.

envir

The environment where to evaluate any R expression used internally by the R CMD call.

dryrun

If TRUE, nothing is evaluated.

Value

(logical; invisible) TRUE or FALSE.

Installation

This function should be called at the end of the ‘Rprofile’ startup file. You can use rcli::install() to automatically append:

if (nzchar(Sys.getenv("R_CMD")) && require("rcli", quietly=TRUE)) rcli::r_cmd_call()

to your ‘~/.Rprofile’ file.

The renviron feature

When extras include "renviron", this function will add support for the --renviron=<name> command-line option to R CMD build and R CMD check. When specified, R CMD build --renviron=<name> will run with R_BUILD_ENVIRON set to ‘~/.R/<name>-build.Renviron’. Similarly, R CMD check --renviron=<name> will run with R_CHECK_ENVIRON set to ‘~/.R/<name>-check.Renviron’.


HenrikBengtsson/rcli documentation built on April 28, 2020, 12:36 a.m.