match_arg {oeli}R Documentation

Argument matching

Description

This function matches function arguments and is a modified version of match.arg.

Usage

match_arg(arg, choices, several.ok = FALSE, none.ok = FALSE)

Arguments

arg

A character (vector), the function argument.

choices

A character (vector) of allowed values for arg.

several.ok

Either TRUE if arg is allowed to have more than one element, or FALSE else.

none.ok

Either TRUE if arg is allowed to have zero elements, or FALSE else.

Value

The un-abbreviated version of the exact or unique partial match if there is one. Otherwise, an error is signaled if several.ok is FALSE or none.ok is FALSE. When several.ok is TRUE and (at least) one element of arg has a match, all un-abbreviated versions of matches are returned. When none.ok is TRUE and arg has zero elements, character(0) is returned.


[Package oeli version 0.5.2 Index]