calculate_age_from_year: Function to calculate age from year of birth

View source: R/IPDFilecheck.R

calculate_age_from_yearR 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)

sheejamk/ipdfilecheck documentation built on March 10, 2024, 11:23 p.m.