Skip to content

rv run

Introduced in rv v0.22.0

Runs an Rscript invocation with the project’s library paths configured, so scripts execute against the packages managed by rv without needing to activate the project first.

By default, rv run syncs the project library before running the script, ensuring it always runs against a library that matches the config and lock files.

Terminal window
rv run [--no-sync] [args]...
  • args - The Rscript arguments to run, e.g. a script path and any arguments it takes. Everything after rv run (and --no-sync, if present) is passed through to Rscript unmodified.
  • --no-sync must be first - Skip syncing the project library before running the command. Because all other arguments are passed through to Rscript as-is, this flag must be given as the very first argument or it will be treated as an argument to your script instead.
Terminal window
% rv run analysis.R
+ tibble (3.2.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
...

To skip the sync and run directly against the current library:

Terminal window
% rv run --no-sync analysis.R