| visTable | R Documentation |
<data.table>This function combines the functionalities of formatEstimateValue(),
formatEstimateName(), formatHeader(), and formatTable()
into a single function. While it does not require the input table to be
a <summarised_result>, it does expect specific fields to apply some
formatting functionalities.
visTable(
result,
estimateName = character(),
header = character(),
groupColumn = character(),
rename = character(),
type = NULL,
hide = character(),
style = NULL,
.options = list()
)
result |
A table to format. |
estimateName |
A named list of estimate names to join, sorted by
computation order. Use |
header |
A vector specifying the elements to include in the header.
The order of elements matters, with the first being the topmost header.
The vector elements can be column names or labels for overall headers.
The table must contain an |
groupColumn |
Columns to use as group labels, to see options use
*tidy: The tidy format applied to column names replaces "_" with a space and
converts to sentence case. Use |
rename |
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. |
type |
Character string specifying the desired output table format.
See |
hide |
Columns to drop from the output table. |
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
|
.options |
A named list with additional formatting options.
|
A formatted table of the class selected in "type" argument.
result <- mockSummarisedResult()
result |>
visTable(
estimateName = c("N%" = "<count> (<percentage>)",
"N" = "<count>",
"Mean (SD)" = "<mean> (<sd>)"),
header = c("Estimate"),
rename = c("Database name" = "cdm_name"),
groupColumn = c("strata_name", "strata_level"),
hide = c("additional_name", "additional_level", "estimate_type", "result_type")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.