match.arg.exact | R Documentation |
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.
match.arg.exact(arg, choices, several.ok = FALSE, exact = TRUE)
arg |
a character vector (of length one unless |
choices |
a character vector of candidate values |
several.ok |
logical specifying if |
exact |
require exact matching |
# this fails
# MARSS:::match.arg.exact(c("a"), c("aa", "bb"))
# this does not
match.arg(c("a"), c("aa", "bb"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.