BATCH

0th

Percentile

Batch Execution of R

Run Rnon-interactively with input from infile and send output (stdout/stderr) to another file.

Keywords
utilities
Usage
R CMD BATCH [options] infile [outfile]
Arguments
infile
the name of a file with Rcode to be executed.
options
a list of Rcommand line options, e.g., for setting the amount of memory available and controlling the load/save process. If infile starts with a -, use as the final option. The default options are . (Without on Windows.)
outfile
the name of a file to which to write output. If not given, the name used is that of infile, with a possible .R extension stripped, and .Rout appended.
Details

Use R CMD BATCH --help to be reminded of the usage.

By default, the input commands are printed along with the output. To suppress this behavior, add options(echo = FALSE) at the beginning of infile, or use option .

The infile can have end of line marked by LF or CRLF (but not just CR), and files with an incomplete last line (missing end of line (EOL) mark) are processed correctly.

A final expression proc.time() will be executed after the input script unless the latter calls q(runLast = FALSE) or is aborted. This can be suppressed by the option .

Additional options can be set by the environment variable R_BATCH_OPTIONS: these come after the default options (see the description of the options argument) and before any options given on the command line.

Note

Unlike Splus BATCH on a Unix-alike, this does not run the Rprocess in the background. In most shells, R CMD BATCH [options] infile [outfile] & will do so.

Aliases
• BATCH
Documentation reproduced from package utils, version 3.3, License: Part of R 3.3

Community examples

Looks like there are no examples yet.