check_value | R Documentation |
Within a function, this function checks the value of an input to an argument of that function. If the input value is supported, the function simply returns this value. If the input is not supported, the function either throws an error or returns a warning and the default value.
check_value( arg = deparse(substitute(input)), input, supp, warn = TRUE, default = supp[1] )
arg |
A character string which defines the argument of the parent function. |
input |
The input to an argument of a parent function. |
supp |
A vector of supported input values for the argument in the parent function. |
warn |
A logical input which defines whether or not to return a warning and the default value (see |
default |
The default input value for the parent function. |
The function returns input
, an error or a warning and default
depending on whether or not input
is within supp
(i.e., whether or not the input to the argument of a parent function is supported).
Edward Lavender
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.