Function to check the format of 'age' in data
testAge(data, agecolumn = "age", nrcode = NA)
a data frame
column name that corresponds to age or date pf birth
non response code corresponding to age column
0, if success -1 if failure
# NOT RUN { testAge(data.frame("Age"= c(21,15), "Name"= c("John","Dora")),"age",999) # }
Run the code above in your browser using DataCamp Workspace