visOmopTable {visOmopResults}R Documentation

Format a summarised_result object into a gt, flextable or tibble object

Description

Format a summarised_result object into a gt, flextable or tibble object

Usage

visOmopTable(
  result,
  formatEstimateName,
  header,
  split,
  groupColumn = NULL,
  type = "gt",
  renameColumns = NULL,
  showMinCellCount = TRUE,
  minCellCount = lifecycle::deprecated(),
  excludeColumns = c("result_id", "estimate_type"),
  .options = list()
)

Arguments

result

A summarised_result.

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 (cdm_name, group, strata, additional, variable, estimate, and settings).

split

A vector containing the name-level groups to split ("group", "strata", "additional"), or an empty character vector to not split.

groupColumn

Columns to use as group labels. By default the name of the new group will be the column names separated by "_". To specify a new grouping name enter a named list such as: list(newGroupName = c("variable_name", "variable_level"))

type

Type of desired formatted table, possibilities: "gt", "flextable", "tibble".

renameColumns

Named vector to customise column names, for instance: c("Database name" = "cdm_name")). By default column names are transformed to sentence case.

showMinCellCount

If TRUE, suppressed estimates will be indicated with "<{minCellCount}", otherwise the default na defined in .options will be used.

minCellCount

[Deprecated] Suppression of estimates when counts < minCellCount should be done before with ompogenerics::suppress().

excludeColumns

Columns to drop from the output table.

.options

Named list with additional formatting options. visOmopResults::optionsVisOmopTable() shows allowed arguments and their default values.

Value

A tibble, gt, or flextable object.

Examples

mockSummarisedResult() |>
visOmopTable(
  formatEstimateName = c("N%" = "<count> (<percentage>)",
                         "N" = "<count>",
                         "Mean (SD)" = "<mean> (<sd>)"),
  header = c("group"),
  split = c("group","strata",  "additional")
)


[Package visOmopResults version 0.3.0 Index]