validate_scale | R Documentation |
This function checks whether a vector for a given questionnaire item or scale is valid.
validate_scale(x, lower_bound = NA, upper_bound = NA)
x |
A numeric (integer) vector representing the response to a questionnaire item (valid values are between the values set by the
|
lower_bound |
A numeric (integer) vector representing the value below which x is invalid. |
upper_bound |
A numeric (integer) vector representing the value above which x is invalid. |
Returns a numeric (integer) vector (if valid) or NA (if not valid).
validate_scale( x = c(0:10, NA, "7"), lower_bound = 1, upper_bound = 7 ) # [1] NA 1 2 3 4 5 6 7 NA NA NA NA 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.