
create a ggplot from the output of summariseLargeScaleCharacteristics.
Source:R/plotLargeScaleCharacteristics.R
plotLargeScaleCharacteristics.RdUsage
plotLargeScaleCharacteristics(
result,
facet = c("cdm_name", "cohort_name"),
colour = "variable_level",
style = "default"
)Arguments
- result
A summarised_result object.
- facet
Columns to facet by. See options with
availablePlotColumns(result). Formula is also allowed to specify rows and columns.- colour
Columns to color by. See options with
availablePlotColumns(result).- style
Named list that specifies how to style the different parts of the table generated. It can either be a pre-defined style ("default" or "darwin" - the latter just for gt and flextable), NULL to get the table default style, or custom. Keep in mind that styling code is different for all table styles. To see the different styles see
visOmopResults::tableStyle().
Examples
if (FALSE) { # \dontrun{
library(CohortCharacteristics)
library(omock)
library(DrugUtilisation)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
cdm <- generateIngredientCohortSet(
cdm = cdm, name = "my_cohort", ingredient = "acetaminophen"
)
resultsLsc <- cdm$my_cohort |>
summariseLargeScaleCharacteristics(
window = list(c(-365, -1), c(1, 365)),
eventInWindow = "condition_occurrence"
)
resultsLsc |>
plotLargeScaleCharacteristics(
facet = c("cdm_name", "cohort_name"),
colour = "variable_level"
)
cdmDisconnect(cdm)
} # }