# \donttest{
library(CohortCharacteristics)
library(PatientProfiles)
library(dplyr, warn.conflicts = FALSE)
cdm <- mockCohortCharacteristics(numberIndividuals = 100)
counts <- cdm$cohort2 |>
addSex() |>
addAge(ageGroup = list(c(0, 29), c(30, 59), c(60, Inf))) |>
summariseCohortCount(strata = list("age_group", "sex", c("age_group", "sex"))) |>
filter(variable_name == "Number subjects")
#> ℹ summarising data
#> ✔ summariseCharacteristics finished!
counts |>
plotCohortCount(
x = "sex",
facet = cohort_name ~ age_group,
colour = "sex"
)
mockDisconnect(cdm)
# }