validate_data | R Documentation |
validate_data
is used to ensure all of the predictors are in the expected
format before making predictions. This function is called internally by
predictALARM()
.
validate_data(data)
data |
A
|
Total annual household income (hhinc
) is a categorical variable with six
levels:
0 = < 2,500 yuan
1 = 2,500-4,999 yuan
2 = 5,000-9,999 yuan
3 = 10,000-19,999 yuan
4 = 20,000-34,999 yuan
5 = >= 35,000 yuan
Throws an informative error if data are invalid, otherwise nothing.
data <- data.frame(age = 70, sex = 1, fhx_cancer = 1,
phx_cancer = 0, fev1fvc = 70, phx_lungdx = 1,
hhinc = 3, bmi = 30,
smk_status = c(1, 2), smk_duration = c(NA, 40),
smk_cigpday = c(NA, 20))
validate_data(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.