read_args: Concise method to read in all arguments passed to an R script...

Description Usage Arguments Value Examples

View source: R/read_args.R

Description

Function to simplify reading in trailing arguments for a launched script. Designed for concise syntax and a more scalable interface. Arguments can be passed in as both quoted and unquoted strings.

Usage

1

Arguments

...

Pass in the variable names to assign to each trailing argument. Can be either symbols (names) or strings. Number of arguments passed in to this function must match exactly the number of trailing arguments. Trailing commandline arguments and arguments are paired up 1 to 1, so the order must match as well (but is not checked).

Value

Variables for each trailing commandline argument with the given names.

Examples

1
2
read_args(my_name, my_script, info) # read in trailing arguments as variables named `my_name`, `my_script`, and `info`
read_args("location_id", "root_dir", "out_dir", "last_arg")

ShadeWilson/ihme documentation built on May 20, 2019, 8:47 a.m.