powered by
Function to check the format of 'age' in data
test_age(data, agecolumn = "age", nrcode = NA)
0, if success error if failure
a data frame
column name that corresponds to age or date pf birth
non response code corresponding to age column
df <- data.frame("Age" = c(21, 15), "Name" = c("John", "Dora")) test_age(df, "age", 999)
Run the code above in your browser using DataLab