Learn R Programming

IPDFileCheck (version 0.3.0)

calculateAgeFromBirthYear: Function to calculate age from year of birth

Description

Function to calculate age from year of birth

Usage

calculateAgeFromBirthYear(data, columnname, nrcode = NA)

Arguments

data

a data frame

columnname

name of column corresponding to year of birth

nrcode

non response code corresponding to date of birth

Value

data, if success -1 if failure

Examples

Run this code
# NOT RUN {
calculateAgeFromBirthYear(data.frame("yob" = c(1951,1980), "Name" = c("John","Dora")),"yob",NA)
# }

Run the code above in your browser using DataLab