View source: R/exportSummaryStatisticsTable.R
export.summaryTable | R Documentation |
docx
, pptx
or html
format (interactive table)The use of export
is recommended.
exportSummaryStatisticsTable
is retained for
back-compatibility.
## S3 method for class 'summaryTable'
export(...)
exportSummaryStatisticsTable(
summaryTable,
rowVar = getAttribute(summaryTable, "rowVar"),
rowVarLab = getAttribute(summaryTable, "rowVarLab", default = getLabelVar(rowVar,
labelVars = labelVars)),
rowVarInSepCol = NULL,
rowVarFormat = NULL,
rowVarTotalInclude = getAttribute(summaryTable, "rowVarTotalInclude"),
rowTotalLab = NULL,
rowVarTotalInSepRow = getAttribute(summaryTable, "rowVarTotalInSepRow"),
rowAutoMerge = TRUE,
colVar = getAttribute(summaryTable, "colVar"),
colTotalLab = getAttribute(summaryTable, "colTotalLab", default = "Total"),
colHeaderTotalInclude = TRUE,
colHeaderMerge = TRUE,
statsVar = getAttribute(summaryTable, "statsVar"),
statsLayout = getAttribute(summaryTable, "statsLayout", default = ifelse("DT" %in%
outputType, "col", "row")),
statsValueLab = "StatisticValue",
statsLabInclude = NULL,
emptyValue = "-",
labelVars = NULL,
file = NULL,
title = NULL,
outputType = "flextable",
pageDim = NULL,
columnsWidth = NULL,
landscape = (style == "presentation"),
margin = 1,
rowPadBase = 14.4,
footer = NULL,
style = "report",
colorTable = getColorPaletteTable(style = style),
fontsize = switch(style, report = 8, presentation = 10),
fontname = switch(style, report = "Times", presentation = "Tahoma"),
vline = "none",
hline = "auto",
expandVar = NULL,
noEscapeVar = NULL,
barVar = NULL,
...
)
... |
(DT output) Extra parameters passed to the
|
summaryTable |
A |
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 |
rowVarInSepCol |
Character vector with |
rowVarFormat |
(flextable output) Named list with special formatting for the |
rowVarTotalInclude |
Character vector with |
rowTotalLab |
(flextable output) string with label for the row with total. |
rowVarTotalInSepRow |
Character vector with |
rowAutoMerge |
(flextable output) Logical, if TRUE (by default) automatically merge rows, e.g. in case there is only one sub-category (e.g. categorical variable with only one group) or only one statistic per category. |
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. |
colTotalLab |
String, label for the total column 'Total' by default. |
colHeaderTotalInclude |
Logical, if TRUE include the total of number of patients
( |
colHeaderMerge |
(flextable output) Logical, if TRUE (FALSE by default) the column header is merged. |
statsVar |
Character vector with columns of |
statsLayout |
String with layout for the statistics names (in case more than one statistic is included), among:
|
statsValueLab |
String with label for the statistic value,
'StatisticValue' by default. |
statsLabInclude |
Logical, if TRUE include the statistic label
in the table. |
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. |
labelVars |
(optional) Named character vector with label for
the row, column variable(s) or variable(s) to summarize. |
file |
(Optional) Name of the file the table should be exported to, either:
If NULL (by default), the summary table is not exported but only returned as output.
If |
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 |
outputType |
String with output type:
|
pageDim |
Numeric vector of length 2 with page width and height.
|
columnsWidth |
(expert mode) Column widths of the table. This is only used
for flextable and DT tables. |
landscape |
(flextable output) Logical, if TRUE the file is in landscape format. |
margin |
(flextable output) Margin in the document in inches
(1 by default).
This is used to specify the width of the table, from:
[ |
rowPadBase |
(flextable output) Base padding for row (in points), 14.4 by default (corresponds to 0.2 inches) |
footer |
(flextable output) Character vector with footer(s) for the table. Set to NULL (by default) if no footer should be included. |
style |
(flextable output) String with table style, either 'report' or 'presentation'. This parameter affects the fontsize, font family, color of the text and background, and table dimensions of the table. |
colorTable |
(flextable output) Named character vector with color for the table background/body/text/line,
e.g. created with the |
fontsize |
(flextable output) Integer with font size, by default:
8 if |
fontname |
(flextable output) String with font name, by default:
'Times' if |
vline |
(flextable output) String mentioning how vertical lines should be included in the body of the table, either:
|
hline |
(flextable output) String mentioning how horizontal lines should be included in the body of the table, either:
|
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 |
barVar |
(DT output) Character vector with variables of |
Depending on the outputType
:
'data.frame-base': input summary table in a long format with all computed statistics
'data.frame': summary table in a wide format (
different columns for each colVar
), with specified labels
'flextable' (by default): flextable
object with summary table
'DT': datatable
object with summary table
If multiple outputType
are specified, a list of those objects, named
by outputType
.
If byVar
is specified, each object consists of a list of tables,
one for each element in byVar
.
export(summaryTable)
: export summaryTable
object
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.