tableTreatment {DrugUtilisation} | R Documentation |
Format a summarised_treatment result into a visual table.
Description
Usage
tableTreatment(
result,
header = c("window_name"),
splitStrata = TRUE,
cdmName = TRUE,
groupColumn = c("cdm_name", "cohort_name"),
type = "gt",
formatEstimateName = c(`N (%)` = "<count> (<percentage> %)"),
.options = list()
)
Arguments
result |
A summarised_result object with results from summariseTreatmentFromCohort() or summariseTreatmentFromConceptSet(). |
header |
A vector containing which elements should go into the header
in order. Allowed values: |
splitStrata |
If TRUE strata columns will be split. |
cdmName |
If TRUE database names will be displayed. |
groupColumn |
Column to use as group labels. Allowed values: |
type |
Type of desired formatted table, possibilities: "gt", "flextable", "tibble". |
formatEstimateName |
Named list of estimate name's to join, sorted by computation order. Indicate estimate_name's between <...>. |
.options |
Named list with additional formatting options. DrugUtilisation::defaultTableOptions() shows allowed arguments and their default values. |
Value
A table with a formatted version of summariseTreatment() results.
Examples
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
result <- cdm$cohort1 |>
summariseTreatment(
treatmentCohortName = "cohort2",
window = list(c(0, 30), c(31, 365))
)
tableTreatment(result)