age_at_date | R Documentation |
Get age (in years) as of a particular date.
NOTE: This result is approximate, since only the year and month of birth are provided. The day of birth is assumed to be 15.
age_at_date( data, date, year_of_birth_col = f.34.0.0.Year_of_birth, month_of_birth_col = f.52.0.0.Month_of_birth )
data |
The primarydata frame. Thisdata frame includes all necessary columns required to perform look-ups (e.g. ICD10 code columns, medication code columns, age, sex, etc.). |
date |
Target date, as a string which is then passed to |
year_of_birth_col |
Template column name for year of birth. |
month_of_birth_col |
Template column name for month of birth. |
Numeric vector of age in years (age_at_date()
), or character vector of age groups (age_group_at_date()
)
Most functions in this package will take column names (*_col
) as optional arguments (otherwise a default column names are used) which are then used as templates to find all other columns with the same field number, but different instance and array numbers. These functions will automatically find all matching instances (and arrays within each instance) within the specified parameters. Internally, a set of expand_instance_*()
helper functions, which themselves rely on the column_expansion_helper()
function, perform the work of searching for matching columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.