tableDrugUtilisation {DrugUtilisation} | R Documentation |
Format a drug_utilisation object into a visual table.
Description
Usage
tableDrugUtilisation(
result,
header = c("group", "strata"),
splitStrata = TRUE,
cohortName = TRUE,
cdmName = TRUE,
conceptSet = TRUE,
ingredient = TRUE,
groupColumn = NULL,
type = "gt",
formatEstimateName = c(`N (%)` = "<count_missing> (<percentage_missing> %)", N =
"<count>", `Mean (SD)` = "<mean> (<sd>)", `Median (Q25 - Q75)` =
"<median> (<q25> - <q75>)"),
.options = list()
)
Arguments
result |
A summarised_result object with results from summariseDrugUtilisation(). |
header |
A vector containing which elements should go into the header
in order. Allowed are: |
splitStrata |
If TRUE strata columns will be split. |
cohortName |
If TRUE cohort names will be displayed. |
cdmName |
If TRUE database names will be displayed. |
conceptSet |
If TRUE concept sets name will be displayed. |
ingredient |
If TRUE ingredients names will be displayed for dose calculation. |
groupColumn |
Column to use as group labels, these can be: "cdm_name", "cohort_name", "concept_set", "variable_name", and/or "ingredient". If strata is split, any of the levels can be used, otherwise "strata_name" and "strata_level" can be used for table group format. |
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 summariseIndication() results.
Examples
library(DrugUtilisation)
library(CodelistGenerator)
cdm <- mockDrugUtilisation()
codelist <- CodelistGenerator::getDrugIngredientCodes(cdm, "acetaminophen")
cdm <- generateDrugUtilisationCohortSet(cdm, "dus_cohort", codelist)
cdm[["dus_cohort"]] %>%
summariseDrugUtilisation(ingredientConceptId = 1125315) |>
tableDrugUtilisation()