exportSummaryStatisticsTableToDT: Export summary table to an interactive DT table, e.g. to be...

View source: R/DT-exportSummaryStatisticsTableToDT.R

exportSummaryStatisticsTableToDTR Documentation

Export summary table to an interactive DT table, e.g. to be exported into an html document.

Description

Export summary table to an interactive DT table, e.g. to be exported into an html document.

Usage

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,
  ...
)

Arguments

summaryTable

Summary table as provided by the formatSummaryStatisticsTable.

rowVar

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.

rowVarLab

Named character vector with label for the rowVar variable(s).

rowVarInSepCol

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'.

statsVar

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.

statsLayout

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)

statsValueLab

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.

title

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).

expandVar

(DT output) Character vector with variables of the summary table which should be expanded in the data.

noEscapeVar

(DT output) Character vector with variables of summaryTable which shouldn't be escaped in the table (e.g. containing URLs).

barVar

(DT output) Character vector with variables of summaryTable that should be represented as a bar.

pageDim

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))

labelVars

(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.

file

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

Value

A datatable object.

Author(s)

Laure Cougnaud


inTextSummaryTable documentation built on Sept. 12, 2023, 5:06 p.m.