View source: R/table_default.R
| table_default | R Documentation |
Display a formatted table in the console
table_default(
x,
justify_cols = "center",
digits = 3,
digits_by_col = NULL,
scientific = FALSE,
na_print = "",
min_width = NULL,
border_char = options("tab_default")$tab_default$border_char,
show_row_names = FALSE,
center_table = FALSE,
n_space = 2,
title = NULL,
style_colnames = NULL,
style_columns = NULL,
nrows = getOption("tab_default")$nrows,
vb = list(),
auto_wrap = TRUE,
wrap_threshold = 1,
...
)
x |
A data frame or tibble. |
justify_cols |
Alignment: a single string, vector, or named list of "left"/"right"/"center". |
digits |
Digits to round numeric columns to. Default |
digits_by_col |
Named list of per-column digit overrides. |
scientific |
Display numerics in scientific notation? Default |
na_print |
String for missing values. Default |
min_width |
Minimum column width. Default |
border_char |
Character for borders. Default |
show_row_names |
Show row names? Default |
center_table |
Center table in terminal? Default |
n_space |
Spaces between columns. Default |
title |
Optional title string above the table.
from |
style_colnames |
Styling for column header cells. A |
style_columns |
Styling for data cells. A |
nrows |
Max rows to display before truncation. |
vb |
Vertical border spec: |
auto_wrap |
Auto-wrap wide tables? Default |
wrap_threshold |
Fraction of console width before wrapping. Default |
... |
Reserved for future use. |
Invisibly returns the input data as a character matrix after
formatting has been applied. The function is called primarily for
its side effect of printing a styled table to the R console.
Returns invisible(NULL) early if the input has 0 rows and 0 columns,
or if it has 0 columns.
table_default(head(mtcars))
table_default(head(mtcars), style_columns = td_style(mpg = "cyan", cyl = "magenta"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.