Format summary statistics table for export
formatSummaryStatisticsTable(
summaryTable,
rowVar = getAttribute(summaryTable, "rowVar"),
colVar = getAttribute(summaryTable, "colVar"),
colTotalLab = getAttribute(summaryTable, "colTotalLab", default = "Total"),
colHeaderTotalInclude = TRUE,
statsVar = getAttribute(summaryTable, "statsVar"),
statsLabInclude = NULL,
statsLayout = "row",
statsValueLab = "StatisticValue",
emptyValue = "-"
)
summaryTable reformatted to wide format
A summaryTable
object.
Character vector with variable(s) to be included in the rows. If multiple variables are specified, the variables should be sorted in hierarchical order (e.g. body system class before adverse event term) and are nested in the table.
Character vector with variable(s) to be included in columns.
If multiple variables are specified, the variables should
be sorted in hierarchical order,
and are included in multi-columns layout.
Use: 'variable' to include the variables to summarize: var
(if multiple) in different columns.
String, label for the total column 'Total' by default.
Logical, if TRUE include the total of number of patients
('statN'
) in the column header.
Character vector with columns of summaryTable
with
statistic variables. For the export: if not specified, all columns of data
besides row, column variables, 'variable', 'variableGroup'
and 'isTotal' are considered.
Logical, if TRUE include the statistic label
in the table.
By default only included if more than
one statistic variables are available in the table.
String with layout for the statistics names (in case more than one statistic is included), among:
row (by default for 'flextable' output):
All statistics are
included in different rows in the first column of the table (after the row variable(s))
'col' (by default for 'DT' output):
Statistics are included
in separated columns (last row of the header).
This option is not compatible with categorical variable(s).
'rowInSepCol':
Statistics are included in different rows,
but in a separated column than the rowVar
variable(s)
String with label for the statistic value,
'StatisticValue' by default.
This is only included in the table if the statistics provided in
stats
are not named and if no colVar
is specified.
String with placeholder used to fill the table for missing values, '-' by default. This value is typically used e.g. if not all statistics are computed for all specified row/col/var variables.
Laure Cougnaud