opt_get_args: Return arguments to Rscript

Description Usage Arguments Value See Also Examples

Description

Arguments to a script are those following the --args argument.

Usage

1

Arguments

opts

character; vector of arguments, (Default: commandArgs())

Returns the user provided arguments, i.e. those following (the first) --args flag. This is identical to what is done by commandArgs( trailingOnly = TRUE ) does. This is included an used since it supports testing/modifying the commandArgs array.

Value

character; vector stripping elements preceding and including (the first) --args flag.

See Also

Examples

1
2
3
4
5
  opt_get_args()
  opt_get_args( opts=c( "Rscript", "-a", "-b", "--args", "-c", 3, "-d" ) )  # "-c" "3" "-d"
  opt_get_args( opts=c( "-a", "-b", "--args", "-c", "--args", "-d" ) )  # "-c" "-d"
  opt_get_args( opts=c( "--foo", "bar") ) 
  

optigrab documentation built on May 2, 2019, 2:10 a.m.