Skip to main content

builtin_match_arg

Function builtin_match_arg 

Source
fn builtin_match_arg(
    args: &[RValue],
    named: &[(String, RValue)],
) -> Result<RValue, RError>
Expand description

Match an argument to a set of candidate values.

Performs exact and then partial matching against the choices vector. When called without explicit choices, looks up the calling function’s formals to determine valid choices (R’s standard behavior for match.arg(arg) inside a function with arg = c("a","b","c")).

@param arg character scalar (or vector if several.ok=TRUE) to match @param choices character vector of allowed values @param several.ok logical; if TRUE, allow arg to have length > 1 @return the matched value(s)