matchArg: Character and Logical Argument Verification

View source: R/utils.R

matchArgR Documentation

Character and Logical Argument Verification

Description

matchArg matches arg against a table of candidates values as specified by choices, where NULL means to take the first one.

Usage

matchArg(arg, choices)

Arguments

arg

a character vector of length one

choices

a character vector of candidate values

Details

In the one-argument form matchArg(arg), the choices are obtained from a default setting for the formal argument arg of the function from which matchArg was called. (Since default argument matching will set arg to choices, this is allowed as an exception to the "length one unless several.ok is TRUE" rule, and returns the first element.)

Value

The unabbreviated version of the exact match


VEuPathDB/veupathUtils documentation built on Feb. 8, 2025, 12:29 p.m.