View source: R/flextable-getListing.R
getListing | R Documentation |
Flextable version >= 0.4.7 and pandoc >= 2.4 is required to included such table in a Rmarkdown document.
getListing(
data,
ft,
border = TRUE,
highlight = integer(),
bgVar = NULL,
fontname = switch(style, report = "Times", presentation = "Tahoma"),
fontsize = switch(style, report = 8, presentation = 10),
landscape = (style == "presentation"),
style = "report",
margin = 1,
adjustWidth = TRUE,
colorTable = getColorPaletteTable(style = style),
align = TRUE,
title = NULL,
pageDim = NULL,
includeRownames = TRUE
)
data |
data.frame with data used in table. |
ft |
Corresponding |
border |
Logical, if TRUE add a border. |
highlight |
Integer vector with index(ices) of column(s) to highlight
(only applies for
|
bgVar |
String with the column of the |
fontname |
String with font name, 'Times' by default. |
fontsize |
Integer with font size, 8 by default. |
landscape |
Logical, if TRUE the table is presented in landscape
format. |
style |
String with table style, either 'report' (by default, a4 format) or 'presentation' |
margin |
Margin in the document in inches, 1 by default. |
adjustWidth |
Logical, if TRUE adjust column widths,
to comply to specification of |
colorTable |
Named character vector with color for the table,
see output of |
align |
Logical, if TRUE (by default), default alignment is set ('center' in all table). |
title |
Character vector with title(s) for the table.
Set to NULL (by default) if no title should be included.
Only available if |
pageDim |
(optional) Numeric vector of length 2 with page width and height in inches in portrait format, in case page dimensions differ from the default implemented report/presentation. These dimensions should include the margins. |
includeRownames |
Logical, if TRUE (by default)
rownames are included in the |
flextable
with style.
# style: report or presentation
getListing(data = head(mtcars), style = "report")
getListing(data = head(mtcars), style = "presentation")
# remove rownames (included by default)
getListing(data = head(mtcars), style = "presentation", includeRownames = FALSE)
# highlight:
# all columns
getListing(data = head(mtcars), style = "presentation", highlight = seq_along(mtcars))
# rownames
getListing(data = head(mtcars), style = "presentation", highlight = 0)
# specific columns
getListing(data = head(mtcars), style = "presentation", highlight = c(2, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.