Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

systemR

Launches another R process from within R


Description

Launches another R process from within R via system() by automatically locating the R executable, cf [1].

Usage

## Default S3 method:
systemR(command="", ..., Rcommand="R", verbose=FALSE)

Arguments

command

A character string be appended to the system() call. If a vector, then the strings are concatenated separated with a space.

...

Additional arguments passed to system().

Rcommand

A character string specifying the basename of the R executable.

verbose

A logical or a Verbose object.

Value

Returns what system() returns.

Author(s)

Henrik Bengtsson

References

[1] R-devel thread 'Best way to locate R executable from within R?', May 22, 2012.

See Also

The R executable is located using R.home(), which is then launched using system().

Examples

res <- systemR("--slave -e cat(runif(1))", intern=TRUE)
cat("A random number: ", res, "\n", sep="")

R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.