
Generate a custom ggplot2 from a summarised_result object generated with summariseDrugRestart() function.
Source:R/plots.R
plotDrugRestart.Rd
Generate a custom ggplot2 from a summarised_result object generated with summariseDrugRestart() function.
Usage
plotDrugRestart(
result,
facet = cdm_name + cohort_name ~ follow_up_days,
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
Which style to apply to the plot, options are: "default", "darwin" and NULL (default ggplot style). Customised styles can be achieved by modifying the returned ggplot object.
Examples
if (FALSE) { # \dontrun{
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
conceptlist <- list("a" = 1125360, "b" = c(1503297, 1503327))
cdm <- generateDrugUtilisationCohortSet(cdm = cdm,
name = "switch_cohort",
conceptSet = conceptlist)
result <- cdm$cohort1 |>
summariseDrugRestart(switchCohortTable = "switch_cohort")
plotDrugRestart(result)
} # }