match.arg.exact {MARSS} | R Documentation |
match.arg with exact matching
Description
The base R match.arg()
uses pmatch()
and does partial matching. This is a problem for many functions where "xtt1"
is different than "xtt"
, say. This function implements exact matching.
Usage
match.arg.exact(arg, choices, several.ok = FALSE, exact = TRUE)
Arguments
arg |
a character vector (of length one unless |
choices |
a character vector of candidate values |
several.ok |
logical specifying if |
exact |
require exact matching |
Examples
# this fails
# MARSS:::match.arg.exact(c("a"), c("aa", "bb"))
# this does not
match.arg(c("a"), c("aa", "bb"))
[Package MARSS version 3.11.9 Index]