powered by
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()
pmatch()
"xtt1"
"xtt"
match.arg.exact(arg, choices, several.ok = FALSE, exact = TRUE)
a character vector (of length one unless several.ok is TRUE).
several.ok
TRUE
a character vector of candidate values
logical specifying if arg should be allowed to have more than one element
arg
require exact matching
# this fails # MARSS:::match.arg.exact(c("a"), c("aa", "bb")) # this does not match.arg(c("a"), c("aa", "bb"))
Run the code above in your browser using DataLab