arg_in_choices: Argument Verification

Description Usage Arguments Value Examples

Description

Tests if a passed-in argument takes a value from a table of candidate values and returns an error message if not.

Usage

1
arg_in_choices(arg, choices, error_message = NULL, call_ = F)

Arguments

arg

Character: passed-in argument name

choices

Character vector: a character vector of candidate values

error_message

Character: user-defined error message

call_

Logical: logical, indicating if the call should become part of the error message. See call. in stop

Value

Error message if test fails

Examples

1
2
alignment <- 'left'
arg_in_choices(alignment, c('left', 'center', 'right'))

statech/CommonPlots documentation built on May 6, 2019, 1:32 a.m.