match_arg: match arg to choices

Description Usage Arguments Value

Description

Wrapper around match.arg that defaults to ignoring case and trimming white space

Usage

1
2
match_arg(arg, choices, multiple = FALSE, ignore_case = TRUE,
  trim_ws = TRUE)

Arguments

arg

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

choices

a character vector of candidate values

multiple

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

ignore_case

logical indicating whether to ignore capitalization. Defaults to TRUE

trim_ws

logical indicating whether to trim surrounding white space. Defaults to TRUE

Value

Value(s) matched via partial matching.


mkearney/tfse documentation built on July 6, 2019, 3:18 a.m.