View source: R/flextable-exportSummaryStatisticsTableToFlextable.R
exportSummaryStatisticsTableToFlextable | R Documentation |
Export summary table to a flextable object, e.g. to be exported in Word or PowerPoint.
exportSummaryStatisticsTableToFlextable(
summaryTable,
rowVar = getAttribute(summaryTable, "rowVar"),
rowVarInSepCol = NULL,
rowVarTotalInclude = getAttribute(summaryTable, "rowVarTotalInclude"),
statsLayout = getAttribute(summaryTable, "statsLayout", default = "row"),
statsVar = getAttribute(summaryTable, "statsVar"),
statsLabInclude = getAttribute(summaryTable, "statsLabInclude", default =
length(statsVar) > 1),
rowVarLab = getAttribute(summaryTable, "rowVarLab", default = getLabelVar(rowVar,
labelVars = labelVars)),
rowVarTotalInSepRow = NULL,
vline = c("none", "auto"),
hline = c("auto", "none"),
rowAutoMerge = TRUE,
rowVarFormat = NULL,
rowTotalLab = NULL,
colHeaderMerge = TRUE,
landscape = (style == "presentation"),
margin = 1,
rowPadBase = 14.4,
title = NULL,
footer = NULL,
style = "report",
colorTable = getColorPaletteTable(style = style),
fontname = switch(style, report = "Times", presentation = "Tahoma"),
fontsize = switch(style, report = 8, presentation = 10),
file = NULL,
pageDim = NULL,
columnsWidth = NULL,
labelVars = NULL
)
summaryTable |
Summary table as provided by the
|
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. |
rowVarInSepCol |
Character vector with |
rowVarTotalInclude |
Character vector with |
statsLayout |
String with layout for the statistics names (in case more than one statistic is included), among:
|
statsVar |
Character vector with columns of |
statsLabInclude |
Logical, if TRUE include the statistic label
in the table. |
rowVarLab |
Named character vector with
label for the |
rowVarTotalInSepRow |
Character vector with |
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:
|
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. |
rowVarFormat |
(flextable output) Named list with special formatting for the |
rowTotalLab |
(flextable output) string with label for the row with total. |
colHeaderMerge |
(flextable output) Logical, if TRUE (FALSE by default) the column header is merged. |
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) |
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 |
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 |
fontname |
(flextable output) String with font name, by default:
'Times' if |
fontsize |
(flextable output) Integer with font size, by default:
8 if |
file |
String with path of the file where the table should be exported.
The file should have the extension: '.html'.
If NULL, the summary table is not exported but only returned as output.
If |
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. |
labelVars |
(optional) Named character vector with label for
the row, column variable(s) or variable(s) to summarize. |
flextable
object with summary table
If summaryTable
is a list of summary tables,
returns a list of flextable
.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.