tableDrugRestart {DrugUtilisation}R Documentation

Format a drug_restart object into a visual table.

Description

[Experimental]

Usage

tableDrugRestart(
  result,
  header = c("strata"),
  splitStrata = TRUE,
  cohortName = 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 summariseDrugRestart().

header

A vector containing which elements should go into the header in order. Allowed values: cdm_name, cohort_name, strata, variable, estimate.

splitStrata

If TRUE strata columns will be split.

cohortName

If TRUE cohort names will be displayed.

cdmName

If TRUE database names will be displayed.

groupColumn

Column to use as group labels. Allowed values: cdm_name, cohort_name, strata, variable_name, variable_level, estimate_name.

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 summariseDrugRestart() results.

Examples


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

tableDrugRestart(result)

CDMConnector::cdmDisconnect(cdm = cdm)



[Package DrugUtilisation version 0.7.0 Index]