calculate_age_from_year: Function to calculate age from year of birth

Description Usage Arguments Value Examples

View source: R/IPDFileCheck.R

Description

Function to calculate age from year of birth

Usage

1
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

1
2
3
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)

IPDFileCheck documentation built on Feb. 1, 2022, 9:07 a.m.