Function that will return tables used in reports.
mst(
tab,
col_names = colnames(tab),
type = "pdf",
cap = "",
label = knitr::opts_current$get("label"),
digs = 0,
align = NULL,
fs = 8,
lsd = FALSE
)
Character string containing RMarkdown table code
Data frame or matrix representing the table.
Character vector with column names. Defaults
colnames(tab)
.
Character string defining output, either "html" or "pdf". Default is "pdf".
Character string with table caption. Empty string by default.
Character string defining the label in case the table needs to
be referenced elsewhere in the overall document. For instance, setting this
to 'my_table' the corresponding inline rmarkdown reference to use is
\@ref(tab:my_table)
. Please note that for this to work for both
LaTex and HTML the bookdown document processing functions must be used,
i.e. bookdown::pdf_document2()
and
bookdown::html_document2()
, respectively. Default value is
knitr::opts_current$get("label")
in which case the name of the
current R chunk will be used as label.
Integer number of digits to use. 0 by default.
Character vector specifying column alignment in the LaTeX way,
e.g. c("l", "c", "r")
will align the first column to the left,
center the second and right-align the last one. Default is NULL in which
case numeric columns are right-aligned and all other columns are
left-aligned.
Integer providing the font size. Applies only for pdf output. Default value is 8.
Logical if table is to be scaled down. Applies only for pdf output. FALSE by default.
mst()
creates RMarkdown code for creating standard tables.