Launches another R process from within R via system
() by automatically locating the
R executable, cf [1].
# S3 method for default
systemR(command="", ..., Rcommand="R", verbose=FALSE)
Additional arguments passed to system
().
A character
string specifying the basename of
the R executable.
Returns what system
() returns.
[1] R-devel thread 'Best way to locate R executable from within R?', May 22, 2012.
The R executable is located using R.home
(), which
is then launched using system
().
# NOT RUN {
res <- systemR("--slave -e cat(runif(1))", intern=TRUE)
cat("A random number: ", res, "\n", sep="")
# }
Run the code above in your browser using DataLab