IPDFileCheck (version 0.3.0)

calculateAgeFromDob: Function to calculate age from date of birth

Description

Function to calculate age from date of birth

Usage

calculateAgeFromDob(data, columnname, dateformat = FALSE, nrcode = NA)

Arguments

data

a data frame

columnname

name of column corresponding to date of birth

dateformat

format of date e.g. dmy default is FALSE

nrcode

non response code corresponding to date of birth

Value

data if success -1 if failure

Examples

Run this code
# NOT RUN {
calculateAgeFromDob(data.frame("dob" = c("1987-05-28","1987-06-18")),"dob","%y-%m-%d")
# }

Run the code above in your browser using DataLab