age_character | R Documentation |
Converts numeric ages into strings expressing the completed years, months and days.
age_character(x, units = c("years", "months"), depth =c("days", "months", "years"),
origin.units = c("years","months"), origin.depth = c("days", "months", "years"),
use.leap = TRUE)
x |
Numeric vector of ages. |
units |
Character specifying the units of the age in output (years or months). |
depth |
Character specifying the depth of the age in output (days, months or years). |
origin.units |
Character specifying the units of the age in input (years or months). |
origin.depth |
Character specifying the depth of the age in input (days, months or years). |
use.leap |
Logical specifying if consider or ignore leap years. |
The function accepts inputs in which the integer part represents the elapsed units of ages (years or months) and the decimal part represents the elapsed portion of elapsed days or months from the last unit, depending on the depth level.
The age completed by the subject.
age_completed
, age_numeric
, age_segment
born <- c("2008-02-17", "2010-08-06", "2008-02-21", "2008-06-25", "2008-04-16", "2009-04-16")
test <- c("2012-05-02", "2011-09-17", "2013-03-09", "2012-01-07", "2013-02-11", "2013-02-11")
(age <- age_completed(born, test))
age_character(age, units="years")
age_character(age, units="months")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.