This function takes data frame input and prints to the console as a markdown table for better readability.

md_table(x, format = "markdown", digits = getOption("jtools-digits",
  2), sig.digits = TRUE, row.names = NA, col.names = NA,
  format.args = list(), align = NULL)

Arguments

x

A data frame or matrix.

format

The style, which can be either "markdown" or "pandoc". Default: "markdown"

digits

How many digits to print for numbers. Default: 2

sig.digits

Should each number be printed with digits number of digits or only when there are at least that many significant digits? Default is TRUE, meaning only print digits number of significant digits.

row.names

Logical: whether to include row names. By default, row names are included if rownames(x) is neither NULL nor identical to 1:nrow(x).

col.names

A character vector of column names to be used in the table.

format.args

A list of arguments to be passed to format() to format table values, e.g. list(big.mark = ',').

align

Column alignment: a character vector consisting of ‘'l'’ (left), ‘'c'’ (center) and/or ‘'r'’ (right). By default or if ‘align = NULL’, numeric columns are right-aligned, and other columns are left-aligned.