calculate_age_from_year {IPDFileCheck}R Documentation

Function to calculate age from year of birth

Description

Function to calculate age from year of birth

Usage

calculate_age_from_year(data, columnname, endyearcol = NULL, nrcode = NA)

Arguments

data

a data frame

columnname

name of column corresponding to year of birth

endyearcol

name of column where the year is entered to calculate the age upto, by default its the current year

nrcode

non response code corresponding to date of birth

Value

data, if success error if failure

Examples

this.data.frame <- data.frame(c(1951, 1980), c("John", "Dora"))
colnames(this.data.frame) <- c("yob", "name")
calculate_age_from_year(this.data.frame, "yob", NULL, NA)

[Package IPDFileCheck version 0.8.1 Index]