<summarised_result>
object into a gt, flextable, or tibble objectThis function combines the functionalities of formatEstimateValue()
,
estimateName()
, formatHeader()
, and formatTable()
into a single function specifically for <summarised_result>
objects.
visOmopTable(
result,
estimateName = character(),
header = character(),
settingsColumn = character(),
groupColumn = character(),
rename = character(),
type = "gt",
hide = character(),
columnOrder = character(),
factor = list(),
showMinCellCount = TRUE,
.options = list()
)
A tibble, gt, or flextable object.
A <summarised_result>
object.
A named list of estimate names to join, sorted by
computation order. Use <...>
to indicate estimate names.
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. Elements in header can be:
Any of the columns returned by tableColumns(result)
to create a header
for these columns.
Any other input to create an overall header.
A character vector with the names of settings to
include in the table. To see options use settingsColumns(result)
.
Columns to use as group labels, to see options use
tableColumns(result)
. By default, the name of the new group will be the
tidy* column names separated by ";". To specify a custom group name, use a
named list such as:
list("newGroupName" = c("variable_name", "variable_level")).
*tidy: The tidy format applied to column names replaces "_" with a space and
converts to sentence case. Use rename
to customise specific column names.
A named vector to customise column names, e.g., c("Database name" = "cdm_name"). The function renames all column names not specified here into a tidy* format.
The desired format of the output table. See tableType()
for
allowed options.
Columns to drop from the output table. By default, result_id
and
estimate_type
are always dropped.
Character vector establishing the position of the columns in the formatted table. Columns in either header, groupColumn, or hide will be ignored.
A named list where names refer to columns (see available columns
in tableColumns()
) and list elements are the level order of that column
to arrange the results. The column order in the list will be used for
arranging the result.
If TRUE
, suppressed estimates will be indicated with
"<{min_cell_count}", otherwise, the default na
defined in .options
will be
used.
A named list with additional formatting options.
visOmopResults::tableOptions()
shows allowed arguments and their default values.
result <- mockSummarisedResult()
result |>
visOmopTable(
estimateName = c("N%" = " ()",
"N" = "",
"Mean (SD)" = " ()"),
header = c("group"),
rename = c("Database name" = "cdm_name"),
groupColumn = strataColumns(result)
)
Run the code above in your browser using DataLab