View source: R/flextable-formatSummaryStatisticsTableFlextable.R
formatSummaryStatisticsTableFlextable | R Documentation |
flextable
Merge nested rows of a summary table
for a format compatible with flextable
formatSummaryStatisticsTableFlextable(
summaryTable,
rowVar = getAttribute(summaryTable, "rowVar"),
rowVarInSepCol = NULL,
rowVarTotalInclude = getAttribute(summaryTable, "rowVarTotalInclude"),
statsLayout = "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("none", "auto"),
rowAutoMerge = TRUE,
rowVarFormat = NULL,
rowTotalLab = NULL,
labelVars = NULL
)
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. |
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. |
labelVars |
(optional) Named character vector with label for
the row, column variable(s) or variable(s) to summarize. |
summaryTable reformatted in long format, with extra attributes:
'header': data.frame with header for each column
'padParams': list of list of parameters to be passed to the
padding
function
'rowVar': column of output with row variable
'rowVarInSepCol': column(s) of output with row variable in separated column(s)
'vlineParams' and 'hlineParams': list of list with correspondingly parameters for vertical and horizontal lines
'vline': vline
parameter
'formatParams': list of list with special formatting for the table,
currently only used if rowVarFormat
if specified.
If summaryTable
is a list of summary tables,
returns a list of corresponding summary tables in long format.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.