| cli_table | R Documentation |
generates a text table
cli_table(
mat,
header = TRUE,
header_style = NULL,
border_style = "single",
heatmap_columns = NULL,
heatmap_colorspace = c("green", "red"),
hilite_rows = NULL,
hilite_style = "bgRed",
NA_style = NULL,
...
)
mat |
the table content to print, can be a data.frame or a matrix |
header |
whether to use the row names as table headers |
header_style |
the (crayon) style to use to print the headers (cf |
border_style |
the style to use for the table borders, one of single, double, single-double, double-single, classic |
heatmap_columns |
the columns that should be displayed as heatmaps, as a vector of column indices, names or logicals |
heatmap_colorspace |
the colorspace to use for the heatmaps, to be passed to |
hilite_rows |
the rows to highlight, as a vector of column indices, names or logicals |
hilite_style |
the (crayon) style to use to highlight the rows (cf |
NA_style |
the (crayon) style to use to highlight the NA values (cf |
... |
Arguments passed on to
|
the lines of the text table as an ansi_string vector
df <- head(datasets::penguins, 20)
ct <- cli_table(df, header_style = "bold",
NA_style = "strikethrough",
heatmap_columns = list("flipper_len"), xmin = 180, xmax = 200,
hilite_rows = !is.na(df$sex) & df$sex == "female" & df$bill_dep >= 19,
hilite_style = "bgGreen"
)
cat(ct, sep = "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.