Description Usage Arguments Details Value Author(s) Examples
Reads a command-line argument supplied to a script.
1 2 3 4 5 6 7 8 | logger.argument(
arg.names,
full.name,
arg.type = "character",
accepted.values = NULL,
default = NULL,
arg.list = commandArgs()
)
|
arg.names |
|
full.name |
One-element |
arg.type |
Variable type of the argument. Must be one of |
accepted.values |
Vector of accepted values for the argument. This must be of the type given in |
default |
Default value for the argument in case it is not specified. Setting this to |
arg.list |
Vector of arguments provided at the execution of the script. The arguments should be provided as name=value pairs. |
This is convenience function for reading parameters supplied to the script in the form name = value.
It expects that logging is enabled (see rnb.options
). The function fails if this condition is
not met.
Argument's value, or NULL
if such is not provided.
Yassen Assenov
1 2 3 | n.iterations <- logger.argument("iterations", "number of iterations", "integer",
accepted.values = 1:100, default = 1L)
logger.close()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.