Description Usage Arguments Value Examples
View source: R/cohort_select.R
Select a subset of cohorts from a ggconsort_cohort
object
1 | cohort_select(.data, ...)
|
.data |
A |
... |
The cohort(s) to pull as an unquoted or
|
A ggconsort_cohort object
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_"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.