cohort_select: Subset ggconsort cohort objects

Description Usage Arguments Value Examples

View source: R/cohort_select.R

Description

Select a subset of cohorts from a ggconsort_cohort object

Usage

1

Arguments

.data

A ggconsort_cohort object

...

The cohort(s) to pull as an unquoted or tidyselect style expression

Value

A ggconsort_cohort object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
cohorts <-
  trial_data %>%
  cohort_start("Assessed for eligibility") %>%
  cohort_define(
    consented = .full %>% dplyr::filter(declined != 1),
    treatment_a = consented %>% dplyr::filter(treatment == "Drug A"),
    treatment_b = consented %>% dplyr::filter(treatment == "Drug B")
  ) %>%
  cohort_label(
    consented = "Consented",
    treatment_a = "Allocated to arm A",
    treatment_b = "Allocated to arm B"
  )

cohorts %>% cohort_select(consented)

cohorts %>%
  cohort_select(starts_with("treatment_"))

tgerke/ggconsort documentation built on Dec. 23, 2021, 8:49 a.m.