apply_table_theme | R Documentation |
Data frame and Tables Pretty Formatting
apply_table_theme(out, x, theme = "default", sub_header_positions = NULL)
export_table(
x,
sep = " | ",
header = "-",
cross = NULL,
empty_line = NULL,
digits = 2,
protect_integers = TRUE,
missing = "",
width = NULL,
format = NULL,
title = NULL,
caption = title,
subtitle = NULL,
footer = NULL,
align = NULL,
by = NULL,
zap_small = FALSE,
table_width = NULL,
verbose = TRUE,
...
)
out |
A |
x |
A data frame. May also be a list of data frames, to export multiple data frames into multiple tables. |
theme |
The theme to apply to the table. One of |
sub_header_positions |
A vector of row positions to apply a border to. Currently particular for internal use of other easystats packages. |
sep |
Column separator. |
header |
Header separator. Can be |
cross |
Character that is used where separator and header lines cross. |
empty_line |
Separator used for empty lines. If |
digits |
Number of digits for rounding or significant figures. May also
be |
protect_integers |
Should integers be kept as integers (i.e., without decimals)? |
missing |
Value by which |
width |
Refers to the width of columns (with numeric values). Can be
either |
format |
Name of output-format, as string. If |
title , caption , subtitle |
Table title (same as caption) and subtitle, as strings. If |
footer |
Table footer, as string. For markdown-formatted tables, table
footers, due to the limitation in markdown rendering, are actually just a
new text line under the table. If |
align |
Column alignment. For markdown-formatted tables, the default
|
by |
Name of column in |
zap_small |
Logical, if |
table_width |
Numeric, or |
verbose |
Toggle messages and warnings. |
... |
Currently not used. |
A data frame in character format.
The values for caption
, subtitle
and footer
can also be provided
as attributes of x
, e.g. if caption = NULL
and x
has attribute
table_caption
, the value for this attribute will be used as table caption.
table_subtitle
is the attribute for subtitle
, and table_footer
for
footer
.
Vignettes Formatting, printing and exporting tables and Formatting model parameters.
export_table(head(iris))
export_table(head(iris), cross = "+")
export_table(head(iris), sep = " ", header = "*", digits = 1)
# split longer tables
export_table(head(iris), table_width = 30)
# colored footers
data(iris)
x <- as.data.frame(iris[1:5, ])
attr(x, "table_footer") <- c("This is a yellow footer line.", "yellow")
export_table(x)
attr(x, "table_footer") <- list(
c("\nA yellow line", "yellow"),
c("\nAnd a red line", "red"),
c("\nAnd a blue line", "blue")
)
export_table(x)
attr(x, "table_footer") <- list(
c("Without the ", "yellow"),
c("new-line character ", "red"),
c("we can have multiple colors per line.", "blue")
)
export_table(x)
# column-width
d <- data.frame(
x = c(1, 2, 3),
y = c(100, 200, 300),
z = c(10000, 20000, 30000)
)
export_table(d)
export_table(d, width = 8)
export_table(d, width = c(x = 5, z = 10))
export_table(d, width = c(x = 5, y = 5, z = 10), align = "lcr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.