[Stable] Match user supplied arguments with supported options and return a logical list for internal usage

match_output_arguments(
  input_args = c(),
  supported_args = c(),
  logger = NULL,
  level = "info"
)

Arguments

input_args

A character vector of input arguments (can be partial).

supported_args

A character vector of supported output arguments.

logger

A character vector indicating the logger to target messages at. Defaults to no logging.

level

Character string defaulting to "info". Logging level see documentation of futile.logger for details. Supported options are "info" and "debug"

Value

A logical vector of named output arguments

Examples

# select nothing
EpiNow2:::match_output_arguments(supported_args = c("fit", "plots", "samples"))
#>     fit   plots samples 
#>   FALSE   FALSE   FALSE 

# select just plots
EpiNow2:::match_output_arguments("plots", supported_args = c("fit", "plots", "samples"))
#>     fit   plots samples 
#>   FALSE    TRUE   FALSE 

# select plots and samples
EpiNow2:::match_output_arguments(c("plots", "samples"),
  supported_args = c("fit", "plots", "samples")
)
#>     fit   plots samples 
#>   FALSE    TRUE    TRUE 

# lazily select arguments
EpiNow2:::match_output_arguments("p",
  supported_args = c("fit", "plots", "samples")
)
#>     fit   plots samples 
#>   FALSE    TRUE    TRUE