gather_collapse_enrollment: Get collapsed enrollment data over multiple...

gather_collapse_enrollmentR Documentation

Get collapsed enrollment data over multiple "enrollment_detail" tables (in parallel)

Description

Get collapsed enrollment data over multiple "enrollment_detail" tables (in parallel)

Usage

gather_collapse_enrollment(
  collect_tab = collect_table(),
  enrolid_list,
  collect_n = Inf,
  vars = c("egeoloc", "msa", "plantyp", "indstry"),
  db_con
)

Arguments

collect_tab

A tibble with the specific setting (i.e. inpatient or outpatient), source (i.e. ccae or mdcr), and year to access Default is all possible combinations of setting, source, and year

enrolid_list

A list of enrolids for which enrollment data will be collected

collect_n

The number of observations to return

vars

Vector of specific variables of interest in the "enrollees" tables (e.g. c("dobyr", "sex"))

db_con

A connection to a database

Value

A tibble with information on each enrolid in enrolid_list. The number of columns in the tibble depends on the number of vars selected

Examples


out <- gather_collapse_enrollment(enrolid_list = final_cohort$enrolid, db_con = db_con, vars = c("egeoloc", "msa", "plantyp" ,"indstry"))


aarmiller/smallDB documentation built on July 9, 2023, 7:22 a.m.