runRversions {berryFunctions}R Documentation

Run code in several R versions

Description

Run code / script in several local R versions

Usage

runRversions(
  scpt = NULL,
  expr = NULL,
  path = "C:/Program Files/R/",
  vrns = dir(path, pattern = "R-"),
  exec = "/bin/Rscript.exe"
)

Arguments

scpt

File path to script. DEFAULT: NULL

expr

Expression to be run. DEFAULT: NULL

path

Location of R versions. DEFAULT: "C:/Program Files/R/"

vrns

R Versions at path. DEFAULT: dir(path,pattern="R-")

exec

Local path to Rscript. DEFAULT: "/bin/Rscript.exe"

Value

Results from each run

Author(s)

Berry Boessenkool, berry-b@gmx.de, May 2022

See Also

help

Examples

tfile <- tempfile(fileext=".R")
cat(
'trace <- function() paste(sapply(sys.calls(),function(x)
                     strsplit(deparse(x),"(", fixed=TRUE)[[1]][1]), collapse=" -> ")
lower <- function(a) {message(trace(), " - msg with ", a+10); a}
upper <- function(b) lower(b+5)
upper(3)', file=tfile)

# Don't actually run with example testing
# out <- source(tfile) ; out$value # message + output 8
# runRversions(tfile)
# runRversions(expr=5+7)


[Package berryFunctions version 1.22.5 Index]