View source: R/plotCohortTiming.R
plotCohortTiming | R Documentation |
plotCohortTiming(
result,
plotType = "boxplot",
timeScale = "days",
uniqueCombinations = TRUE,
facet = c("cdm_name", "cohort_name_reference"),
colour = c("cohort_name_comparator")
)
result |
A summarised_result object. |
plotType |
Type of desired formatted table, possibilities are "boxplot" and "densityplot". |
timeScale |
Time scale to show, it can be "days" or "years". |
uniqueCombinations |
Whether to restrict to unique reference and comparator comparisons. |
facet |
Columns to facet by. See options with
|
colour |
Columns to color by. See options with
|
A ggplot.
## Not run:
library(CohortCharacteristics)
library(duckdb)
library(CDMConnector)
library(DrugUtilisation)
con <- dbConnect(duckdb(), eunomiaDir())
cdm <- cdmFromCon(con, cdmSchem = "main", writeSchema = "main")
cdm <- generateIngredientCohortSet(
cdm = cdm,
name = "my_cohort",
ingredient = c("acetaminophen", "morphine", "warfarin")
)
timings <- summariseCohortTiming(cdm$my_cohort)
plotCohortTiming(
timings,
timeScale = "years",
uniqueCombinations = FALSE,
facet = c("cdm_name", "cohort_name_reference"),
colour = c("cohort_name_comparator")
)
plotCohortTiming(
timings,
plotType = "densityplot",
timeScale = "years",
uniqueCombinations = FALSE,
facet = c("cdm_name", "cohort_name_reference"),
colour = c("cohort_name_comparator")
)
cdmDisconnect(cdm)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.