textab | R Documentation |
Converts a data frame to LaTeX or HTML.
If bold.which
is given it should be a logical matrix specifying bold cells.
Otherwise: in each column or row with numeric data, the maximum or minimum
value is set bold; bold.max
can have entries for each column/row, NA
means skip.
textab(
x,
file = "",
type = c("latex", "html"),
caption = NULL,
label = NULL,
align = NULL,
digits = NULL,
display = NULL,
auto = FALSE,
bold.which = NULL,
bold.each = c("column", "row"),
bold.max = NA,
NA.string = "",
sanitize.text.function = force,
sanitize.rownames.function = NULL,
sanitize.colnames.function = NULL,
...
)
x |
a data frame. |
file |
using this argument, the resulting table is written to a file rather than to the R prompt. The file name can be specified as a character string. |
type |
type of table to produce. Possible values for type are "latex" or "html". |
caption |
argument passed to xtable. |
label |
argument passed to xtable. |
align |
argument passed to xtable. |
digits |
argument passed to xtable. |
display |
argument passed to xtable. |
auto |
argument passed to xtable. |
bold.which |
logical matrix specifying bold cells. |
bold.each |
axis along which to compute the max/min. Possible values for |
bold.max |
whether to boldify maximum values ( |
NA.string |
string to be used for missing values in table entries. |
sanitize.text.function |
argument passed to print.xtable. |
sanitize.rownames.function |
argument passed to print.xtable. |
sanitize.colnames.function |
argument passed to print.xtable. |
... |
additional arguments passed to print.xtable. |
The code is adopted from https://gist.github.com/floybix/452201
x <- tail(iris[,1:4])
textab(x)
textab(x, bold.each = "column", bold.max = c(FALSE, NA, NA, TRUE))
textab(x, bold.each = "row", bold.max = FALSE)
textab(x, bold.which = x >= 6.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.