View source: R/instance_array_helper.R
instance_combiner | R Documentation |
Helper to apply a lookup function to a range of instances, and combine the result.
instance_combiner( data, lookup_by_instance_fn, combine_instances = c("any", "max", "min", "first", "last", "mean"), up_to_instance = default_up_to_inst(), after_instance = default_after_inst() )
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.). |
lookup_by_instance_fn |
Function that takes a target instance as its only argument, and returns a vector of data. |
combine_instances |
The method used by For example, when looking up whether a participant is on a medication, the result may differ depending on the instance number. In such a case, one would want to apply the Can be one of:
Functions that call |
up_to_instance |
An integer specifying an instance number, or the name of the column (using < |
after_instance |
An integer specifying an instance number, or the name of the column (using < |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.