md_table {xfun} | R Documentation |
Generate a simple Markdown pipe table
Description
A minimal Markdown table generator using the pipe |
as column separators.
Usage
md_table(x, digits = NULL, na = NULL, newline = NULL, limit = NULL)
Arguments
x |
A 2-dimensional object (e.g., a matrix or data frame). |
digits |
The number of decimal places to be passed to |
na |
A character string to represent |
newline |
A character string to substitute |
limit |
The maximum number of rows to show in the table. If it is smaller than the number of rows, the data in the middle will be omitted. If it is of length 2, the second number will be used to limit the number of columns. Zero and negative values are ignored. |
Details
The default argument values can be set via global options with the prefix
xfun.md_table.
, e.g., options(xfun.md_table.digits 2, xfun.md_table.na = 'n/a')
.
Value
A character vector.
See Also
knitr::kable()
(which supports more features)
Examples
xfun::md_table(head(iris))
xfun::md_table(mtcars, limit = c(10, 6))