textTable.matrix {tablesgg} | R Documentation |
Create a texttable
from a Matrix
Description
Create a textTable
object from a matrix.
Usage
## S3 method for class 'matrix'
textTable(x, rcnames=c(TRUE, TRUE), title=character(0),
subtitle=character(0), foot=character(0), na="NA", ...)
Arguments
x |
A matrix. |
rcnames |
A logical or character vector of length 2. The first element applies to
rows, the second to columns. If FALSE, row/column names are not included.
If TRUE and |
title , subtitle , foot |
Optional character vectors providing annotation for the table. May be
empty (i.e., |
na |
Character string used to represent missing values (NAs) in the body of the table. |
... |
Additional arguments passed to |
Value
An object with S3 class textTable
. The body of the table will
contain the matrix values, after formatting x
with format(x,
...)
. Row and column names may be included as headers, depending on
argument rcnames
.
Examples
data(iris, package="datasets")
mat <- data.matrix(subset(iris, Species == "setosa")[, 1:4])
ttbl <- textTable(cor(mat), digits=3, title="Correlations for setosa irises")
summary(ttbl)
plt <- plot(ttbl)
# Make hvrules invisible:
propsd(plt, subset=enabled) <- element_hvrule(color=NA)
print(plt)