tableCharacteristics {CohortCharacteristics} | R Documentation |
Format a summarised_characteristics object into a visual table.
Description
'r lifecycle::badge("experimental")'
Usage
tableCharacteristics(
result,
type = "gt",
formatEstimateName = c(`N (%)` = "<count> (<percentage>%)", N = "<count>",
`Median [Q25 - Q75]` = "<median> [<q25> - <q75>]", `Mean (SD)` = "<mean> (<sd>)",
Range = "<min> to <max>"),
header = c("group"),
split = c("group", "strata"),
groupColumn = NULL,
excludeColumns = c("result_id", "estimate_type", "additional_name", "additional_level"),
.options = list()
)
Arguments
result |
A summarised_characteristics object. |
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 <...>. |
header |
A vector containing which elements should go into the header in order. Allowed are: 'cdm_name', 'group', 'strata', 'additional', 'variable', 'estimate', 'settings'. |
split |
A vector containing the name-level groups to split ("group", "strata", "additional"), or an empty character vector to not split. |
groupColumn |
Column to use as group labels. |
excludeColumns |
Columns to drop from the output table. |
.options |
Named list with additional formatting options. CohortCharacteristics::optionsTableCharacteristics() shows allowed arguments and their default values. |
Value
A table with a formatted version of the summariseCharacteristics result.
Examples
library(CohortCharacteristics)
cdm <- mockCohortCharacteristics()
cdm$cohort1 |>
summariseCharacteristics() |>
tableCharacteristics()
mockDisconnect(cdm = cdm)