Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/derive_vars_aage.R
Derives analysis age (AAGE
) and analysis age unit (AAGEU
)
1 2 3 4 5 6 | derive_vars_aage(
dataset,
start_date = BRTHDT,
end_date = RANDDT,
unit = "years"
)
|
dataset |
Input dataset The columns specified by the |
start_date |
The start date A date or date-time object is expected. Default: |
end_date |
The end date A date or date-time object is expected. Default: |
unit |
Unit The age is derived in the specified unit Default: 'years' Permitted Values: 'years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds' |
The age is derived as the integer part of the duration from start to end date in the specified unit.
The input dataset with AAGE
and AAGEU
added
Stefan Bundfuss
1 2 3 4 5 6 | data <- tibble::tribble(
~BRTHDT, ~RANDDT,
lubridate::ymd("1984-09-06"), lubridate::ymd("2020-02-24")
)
derive_vars_aage(data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.