View source: R/calculate_age.R
calculate_age | R Documentation |
Calculate age from date of birth
calculate_age(dob, date = "today", date_format = "ymd", units = "years")
dob |
Date of birth, preferably "YYYY-MM-DD" format |
date |
Date to calculate age from, default is today |
date_format |
defaults to "ymd" "YYYY-MM-DD" format |
units |
units to return age in, default is "years"; other options are "days", "weeks", "months" |
age in years
calculate_age(dob = "Jan 5, 1960", date_format = "mdy")
calculate_age(dob = "1/5/1960", date_format = "mdy")
calculate_age(dob = "1960-01-05", date_format = "ymd")
calculate_age(dob = "1960-01-05", date_format = "ymd", units = "days")
calculate_age(dob = "1960-01-05", date_format = "ymd", units = "weeks")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.