Format a summariseCohortTiming result into a visual table.
Source:R/tableCohortTiming.R
tableCohortTiming.Rd
Usage
tableCohortTiming(
result,
timeScale = "days",
uniqueCombinations = TRUE,
type = "gt",
header = visOmopResults::strataColumns(result),
groupColumn = NULL,
hide = "variable_level"
)
Arguments
- result
A summarised_result object. Output of summariseCohortTiming().
- timeScale
Time scale to plot results. Can be days or years.
- uniqueCombinations
Whether to restrict to unique reference and comparator comparisons.
- type
Type of table. Check supported types with
visOmopResults::tableType()
.- header
Columns to use as header. See options with
tidyColumns(result)
.- groupColumn
Columns to group by. See options with
tidyColumns(result)
.- hide
Columns to hide from the visualisation. See options with
tidyColumns(result)
.
Examples
if (FALSE) { # \dontrun{
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",
facet = c("cdm_name", "cohort_name_reference"),
colour = c("cohort_name_comparator")
)
cdmDisconnect(cdm)
} # }