formatSummaryStatisticsTable: Format summary statistics table for export

View source: R/formatSummaryStatisticsTable.R

formatSummaryStatisticsTableR Documentation

Format summary statistics table for export

Description

Format summary statistics table for export

Usage

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

Arguments

summaryTable

A summaryTable object.

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.

colVar

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.

colTotalLab

String, label for the total column 'Total' by default.

colHeaderTotalInclude

Logical, if TRUE include the total of number of patients ('statN') in the column header.

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.

statsLabInclude

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.

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.

emptyValue

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.

Value

summaryTable reformatted to wide format

Author(s)

Laure Cougnaud


inTextSummaryTable documentation built on June 22, 2024, 9:24 a.m.