Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

match_arg

Argument Verification Using Partial Matching


Description

Similar to match.arg(), match_arg matches arg against a table of candidate values as specified by choices.

Usage

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

Arguments

arg

a character vector (of length one unless several.ok is TRUE) or NULL.

choices

a character vector of candidate values

several.ok

logical specifying if arg should be allowed to have more than one element.

Details

This function resolves errors from match.arg() with ” as arg input.

Value

The matched elements of arg or in case of match failure a detailed error message

Specification

The contents of this section are shown in PDF user manual only.

Examples

## Not run: 
match_arg(arg = c(2, 1), choices = c(4, 3, 1, 2), several.ok = TRUE)
match_arg(arg = c("c", "b"), choices = c("a", "b", "c", "d"), several.ok = TRUE)

## End(Not run)

r2rtf

Easily Create Presentation-Ready Rich Text Format (RTF) Table and Figure

v0.2.0
GPL-3
Authors
Yilong Zhang [aut, cre], Siruo Wang [aut], Simiao Ye [aut], Madhusudhan Ginnaram [aut], Merck Sharp & Dohme Corp [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.