powered by
This is an extensions to match.arg with support for AssertCollection. The behavior is very similar to match.arg, except that NULL is not a valid value for x.
match.arg
AssertCollection
NULL
x
matchArg(x, choices, several.ok = FALSE, .var.name = vname(x), add = NULL)
Subset of choices.
choices
[character] User provided argument to match.
[character()] Candidates to match x with.
[logical(1)] If TRUE, multiple matches are allowed, cf. match.arg.
TRUE
[character(1)] Name of the checked object to print in error messages. Defaults to the heuristic implemented in vname.
character(1)
vname
[AssertCollection] Collection to store assertions. See AssertCollection.
matchArg("k", choices = c("kendall", "pearson"))
Run the code above in your browser using DataLab