opt_assign {optigrab} | R Documentation |
Parse options and assign values
Description
Combines opt_get
and assign
for convenience.
Usage
opt_assign(x, pos = 1, inherits = FALSE, name = x, ...,
assign.na = FALSE)
opt_assign_all(x, ..., assign.na = FALSE)
Arguments
x |
character or list; variable names or alias. If no coercion is done, and the first element of a character vector of length greater than one will be used, with a warning. |
pos |
where to do the assignment. By default, assigns into the current environment. See 'Details' for other possibilities. |
inherits |
logical; should the enclosing frames of the environment be
inspected? This is argument is supplied to |
name |
character; name(s) of option as passed to |
... |
arguments passed to |
assign.na |
logical; whether
|
See Also
Examples
opt_assign( "foo", opts=c("--foo","bar") )
opt_assign( c("foo","f"), opts=c("--foo","baz") )