Calculates age in years based on date of birth and test date. Handles missing dates gracefully.
calculate_age(
data,
dob_col = "dateOfBirth",
test_date_col = "Testdate",
output_col = "age"
)Data frame with added age column.
Data frame containing date columns.
Character. Name of date of birth column. Default is "dateOfBirth".
Character. Name of test date column. Default is "Testdate".
Character. Name for the new age column. Default is "age".
Calculate Age from Date of Birth and Test Date