| plotIndication {DrugUtilisation} | R Documentation | 
Generate a plot visualisation (ggplot2) from the output of summariseIndication
Description
Generate a plot visualisation (ggplot2) from the output of summariseIndication
Usage
plotIndication(
  result,
  x = "window",
  facet = c("cdm_name", "cohort_name", "strata"),
  color = c("indication"),
  splitStrata = TRUE
)
Arguments
| result | A summarised_result object. | 
| x | Variables to be used in the x axis. | 
| facet | Variables to be used to facet the plot. | 
| color | Variables to be used to color the plot. | 
| splitStrata | Whether to split strata. | 
Value
A ggplot2 object
Examples
library(DrugUtilisation)
library(CDMConnector)
library(dplyr)
cdm <- mockDrugUtilisation()
indications <- list("headache" = 378253, "asthma" = 317009)
cdm <- generateConceptCohortSet(cdm, indications, "indication_cohorts")
cdm <- generateIngredientCohortSet(
  cdm = cdm, name = "drug_cohort", ingredient = "acetaminophen"
)
result <- cdm$drug_cohort |>
  summariseIndication(
    indicationCohortName = "indication_cohorts",
    unknownIndicationTable = "condition_occurrence",
    indicationWindow = list(c(-Inf, 0), c(-365, 0))
  )
plotIndication(result)
[Package DrugUtilisation version 0.7.0 Index]