powered by
Function to calculate age from year of birth
calculateAgeFromBirthYear(data, columnname, nrcode = NA)
a data frame
name of column corresponding to year of birth
non response code corresponding to date of birth
data, if success -1 if failure
# NOT RUN { calculateAgeFromBirthYear(data.frame("yob" = c(1951,1980), "Name" = c("John","Dora")),"yob",NA) # }
Run the code above in your browser using DataLab