`r lifecycle::badge("deprecated")`
Usage
plotDemographics(
data,
xAxis = "variable_name",
yAxis = "estimate_value",
plotStyle = "barplot",
facetVarX = "variable_name",
facetVarY = c("group_level", "strata_level"),
colorVars = "variable_level",
vertical_x = FALSE
)
Arguments
- data
output of summariseCharacteristics.
- xAxis
what to plot on x axis, default as variable_name column. Has to be a column in data.
- yAxis
what to plot on y axis, default as estimate_value column. Has to be a column in data. One of the xAxis or yAxis has to be estimate_value.
- plotStyle
Now allows boxplot or barplot only.
- facetVarX
column in data to facet by on horizontal axis
- facetVarY
column in data to facet by on vertical axis
- colorVars
column in data to color by.
- vertical_x
whether to display x axis string vertically.
Examples
# \donttest{
library(PatientProfiles)
cdm <- mockPatientProfiles()
results <- summariseDemographics(
cohort = cdm$cohort1,
ageGroup = list(c(0, 19), c(20, 39), c(40, 59), c(60, 79), c(80, 150))
)
#> Warning: `summariseDemographics()` was deprecated in PatientProfiles 0.8.0.
#> ℹ Please use `CohortCharacteristics::summariseDemographics()` instead.
#> ℹ adding demographics columns
#> ℹ summarising data
#> ℹ The following estimates will be computed:
#> • variable_00023: count, percentage
#> • variable_00027: count, percentage
#> • cohort_start_date: min, q05, q25, median, q75, q95, max
#> • cohort_end_date: min, q05, q25, median, q75, q95, max
#> • variable_00025: min, q05, q25, median, q75, q95, max, mean, sd
#> • variable_00026: min, q05, q25, median, q75, q95, max, mean, sd
#> • variable_00024: min, q05, q25, median, q75, q95, max, mean, sd
#> ! Table is collected to memory as not all requested estimates are supported on
#> the database side
#> → Start summary of data, at 2024-05-11 12:03:53.970116
#> ✔ Summary finished, at 2024-05-11 12:03:54.09353
#> ✔ summariseCharacteristics finished!
graph <- plotDemographics(results)
CDMConnector::cdmDisconnect(cdm = cdm)
# }