Function to calculate age from date of birth
calculateAgeFromDob(data, columnname, dateformat = FALSE, nrcode = NA)
a data frame
name of column corresponding to date of birth
format of date e.g. dmy default is FALSE
non response code corresponding to date of birth
data if success -1 if failure
# NOT RUN { library(IPDFileCheck) calculateAgeFromDob(data.frame("dob"=c("1987-05-28","1987-06-18","1987-07-09"), "num"=c(1,2,3),stringsAsFactors = FALSE),"dob") # }
Run the code above in your browser using DataLab