Skip to contents

A helper function primarily used by table_one() to calculate the number of care sites per person.

Usage

get_person_num_care_sites(ds)

Arguments

ds

A PicnicHealth data set list object.

Value

A data frame, one row per person, with a column for person_id and number_care_sites, i.e. the person's number of care sites where the person had a physical visit.

Details

Beyond its use in table_one(), this function may be useful to add an additional column to an existing analytic data.frame that already contains person_id using dplyr::left_join() to include number_care_sites. See examples.

Examples

if (FALSE) { # \dontrun{
# Add `number_care_sites` to an analytic data set that contains `person_id`:
analytic_dataset %>%
  left_join(get_person_num_care_sites(ds))
} # }