processCommandLine: Scan Parameters From Command Line

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/param.r

Description

The pipeline parameters can be provided via command line.

For example:
R pipeline.r dirproject="/project" maxrepeats=0 modeloutcome="Age"

Each command line argument is treated as an R statement.

All variables defined this way are collected in a list which is returned.

Usage

1

Arguments

.arg

Vector of command line parameters. Obtained from commandArgs if omitted.

Details

If a command line argument defines variable "fileparam", it is assumed to be a filename, and the file with this name is scanned for extra pipeline parameters, as by parametersFromFile.

Value

Returns the list with all the variables set by the statement in the command line.

Note

Variables with names starting with period (.) are ignored.

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

See Also

See vignettes: browseVignettes("ramwas").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
filename = tempfile()

# Assume command line with two components:
# dirproject="."
# modelcovariates=c("Age","Sex")

arg = c(
    "dirproject = \".\"",
    "modelcovariates = c(\"Age\",\"Sex\")")

# Process the command line
param = processCommandLine(arg)

# Show the list
print(param)

andreyshabalin/ramwas documentation built on Sept. 27, 2021, 7:25 p.m.