checkValues | R Documentation |
This function may be used in code generated by reading the WADL and is for cases where a parameter in the REST method has a fixed set of possible values. This function verifies that the user-supplied values are in this set and raises an error otherwise.
In the future, it may return corrected values.
checkValues(value, options, varName = deparse(value), repeating = FALSE)
value |
a character vector of the user-supplied values. |
options |
the set of permitted values; a character vector |
varName |
the name of the variable being matched. Potentially used in the error message. |
repeating |
whether we can have more than one value in
|
The expanded version of value
,
i.e. with any abbreviations replaced by their full form from
options
.
Duncan Temple Lang
match.arg
checkValues("Jan", c("January", "February", "March"))
try(checkValues("Jn", c("January", "February", "March"), "month"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.