Export summary table to an interactive DT table, e.g. to be exported into an html document.
exportSummaryStatisticsTableToDT(
summaryTable,
rowVar = getAttribute(summaryTable, "rowVar"),
rowVarLab = getAttribute(summaryTable, "rowVarLab", default = getLabelVar(rowVar,
labelVars = labelVars)),
rowVarInSepCol = NULL,
statsVar = getAttribute(summaryTable, "statsVar"),
statsLayout = getAttribute(summaryTable, "statsLayout", default = "col"),
statsValueLab = "StatisticValue",
title = NULL,
expandVar = NULL,
noEscapeVar = NULL,
barVar = NULL,
pageDim = NULL,
labelVars = NULL,
file = NULL,
...
)
A datatable
object.
Summary table as provided by the
formatSummaryStatisticsTable
.
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.
Named character vector with
label for the rowVar
variable(s).
Character vector with rowVar
that should be included in separated columns.
By default (NULL), all row variables are nested in the first column
of the table.
To include the groups within a var
variable in a separated column,
set: rowVarInSepCol == 'variableGroup'
.
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.
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.
Character vector with title(s) for the table.
Set to NULL (by default) if no title should be included.
If multiple are specified, specified for each element of byVar
(in order of the levels).
(DT output) Character vector with variables of the summary table which should be expanded in the data.
(DT output) Character vector with variables of summaryTable
which shouldn't be escaped in the table (e.g. containing URLs).
(DT output) Character vector with variables of summaryTable
that should be represented as a bar.
Numeric vector of length 2 with page width and height.
Depending on outputType
:
'flextable': in inches
'DT': in number of rows in the table.
Currently only the height is used (e.g. c(NA, 4)
)
(optional) Named character vector with label for
the row, column variable(s) or variable(s) to summarize.
Labels specified via dedicated parameter: e.g.
rowVarLab
, colVarLab
, varLab
have priority on this parameter.
String with path of the file where the table should be exported.
The file should have the extension: '.docx'.
If NULL, the summary table is not exported but only returned as output.
If byVar
is specified, each table is exported to a separated
file with the suffix: 'file_[i].docx' with i the index of the file.
(DT output) Extra parameters passed to the
getClinDT
Laure Cougnaud