validate_age | R Documentation |
This function checks whether an age is valid (numeric and between 8 and 12). CAPL-2 scores and interpretations are valid for children between the ages of 8 and 12 years.
validate_age(x)
x |
A numeric vector. |
If x
contains a decimal value that is otherwise valid (e.g., 8.5, 10.1), this function will return the floor()
of the value.
Other capl
functions called by this function include: validate_number()
.
Returns a numeric (integer) vector with a value between 8 and 12 (if valid) or NA (if not valid).
validate_age(c(7:13, "", NA, "12", 8.5)) # [1] NA 8 9 10 11 12 NA NA NA 12 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.