View source: R/mandatory_age.R
mandatory_age | R Documentation |
Calculates age as integer based on number of years lived. Takes into account leap years.
mandatory_age(date_of_birth, specimen_date)
date_of_birth |
Patient's date of birth in date format |
specimen_date |
Date of specimen in date format |
Vector of integer ages
library(lubridate)
dob <- dmy("31/01/2000")
spec <- dmy("21/01/2001")
mandatory_age(dob, spec)
# Counter example :
round(as.numeric(spec-dob)/365.25, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.