sunburst_maker converts ordered sunburst data at the patient level to summarized counts in
the nested hierarchical list format needed for the nswidgets:sunburst function.
Usage
sunburst_maker(
cohort,
id_data,
none = "None",
id_var = "patient_id",
gofl_formula = NULL,
collapse_states = NULL,
max_levels = NULL
)Arguments
- cohort
Cohort data.frame. In case you want to add on stratification or filter variables.
- id_data
List. One element for patient level order data, one element with states found in that data. Returned from
sunburst_id_data.- none
Character. How to label the "empty" state. Default is "None".
- id_var
Character. ID variable in cohort. Default "index_date".
- gofl_formula
Formula. Used in
goflto create filters and stratifications.- collapse_states
How to redefine states if combinations are anticipated. As a named
listit allows users to identify how states should be grouped with unique identifiers. As a namedvectorit assigns a hierarchy in the order that the states appear. The names are how the states show up on the sunburst. DefaultNULL.- max_levels
Integer. How many levels (sunburst rings) should be calculated? Max is 8.