cohort_select.Rd
Select a subset of cohorts from a ggconsort_cohort
object
cohort_select(.data, ...)
.data | A |
---|---|
... | The cohort(s) to pull as an unquoted or
|
A ggconsort_cohort
object
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)#> A ggconsort cohort of 1200 observations with 1 cohort: #> - consented (1141)#> A ggconsort cohort of 1200 observations with 2 cohorts: #> - treatment_a (469) #> - treatment_b (469)