cmd_list_interp: Convert list of function arguments to list of command flags

Description Usage Arguments Details Value Examples

View source: R/cmd_args.R

Description

Function also handles error checking to ensure args contain valid data types, and looks for common usage mistakes.

Usage

1
cmd_list_interp(args, flag_lookup = NULL)

Arguments

args

named list output from get*Args family of functions.

flag_lookup

optional named vector used to convert args to command flags

Details

The list structure is more amenable to manipulation by package developers for advanced use before evaluating them to the command flags vector with cmd_list_to_flags().

Value

named list

Examples

1
2
3
4
theFunction <- function(...){cmd_args_all()}
theArgs <- theFunction(arg1 = "value", arg2 = TRUE)
flagList <- cmd_list_interp(theArgs)
flags <- cmd_list_to_flags(flagList)

snystrom/dotargs documentation built on Oct. 18, 2020, 8:39 a.m.