Learn R Programming

renv (version 0.8.0)

run: Run a Script

Description

Run an R script, with an renv project active. The script will be run as an R sub-process.

Usage

run(script, ..., job = NULL, name = NULL, project = NULL)

Arguments

script

The path to an R script.

...

Optional arguments; reserved for future expansion.

job

Run the requested script as an RStudio job? Requires a recent version of both RStudio and the rstudioapi packages. When NULL, the script will be run as a job if possible, and as a regular R process launched by system2() if not.

name

The name to associate with the job, for scripts run as a job.

project

The project directory. If NULL, then the active project will be used. If no project is currently active, then the current working directory is used instead.

Value

The project directory, invisibly. Note that this function is normally called for its side effects.