processCommandLine {ramwas}R Documentation

Scan Parameters From Command Line

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

processCommandLine(.arg = NULL)

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


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)

[Package ramwas version 1.16.0 Index]