runRversions | R Documentation |
Run code / script in several local R versions
runRversions(
scpt = NULL,
expr = NULL,
path = "C:/Program Files/R/",
vrns = dir(path, pattern = "R-"),
exec = "/bin/Rscript.exe"
)
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" |
Results from each run
Berry Boessenkool, berry-b@gmx.de, May 2022
help
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.