Skip to contents

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"
)

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).

Value

A ggplot2 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)

} # }