Years_from_instance_to_death: Years from instance to death

years_from_instance_to_deathR Documentation

Years from instance to death

Description

Years from instance to death

Usage

years_from_instance_to_death(
  data,
  instance_num,
  date_of_instance_col = f.53.0.0.Date_of_attending_assessment_centre,
  death_date_col = f.40000.0.0.Date_of_death
)

Arguments

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.).

instance_num

An integer specifying the instance number, or the name of the column (using <data-masking> rules) containing instance numbers to use in the current function.

date_of_instance_col

Template column name for date of each instance.
Default = f.53.0.0.Date_of_attending_assessment_centre.

death_date_col

Template column name for date of death.
Default = f.40000.0.0.Date_of_death.

Column names

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.


adamleejohnson/R-ukbiobank documentation built on April 25, 2022, 2:11 a.m.