tableplot | R Documentation |
A tableplot (Kwan, 2008) is designed as a semi-graphic display in the form of a table with numeric values, but supplemented by symbols with size proportional to cell value(s), and with other visual attributes (shape, color fill, background fill, etc.) that can be used to encode other information essential to direct visual understanding. Three-way arrays, where the last dimension corresponds to levels of a factor for which the first two dimensions are to be compared are handled by superimposing symbols.
The specifications for each cell are given by the types
argument, whose elements refer
to the attributes specified in patterns.
tableplot(values, ...)
## Default S3 method:
tableplot(
values,
types,
patterns = list(list(0, "black", 1, "white", "white", 0, 0.5, "grey80", FALSE, 1)),
title = "Tableplot",
side.label = "row",
top.label = "col",
table.label = TRUE,
label.size = 1,
side.rot = 0,
gap = 2,
v.parts = 0,
h.parts = 0,
cor.matrix = FALSE,
var.names = "var",
...
)
values |
A matrix or 3-dimensional array of values to be displayed in a tableplot |
... |
Arguments passed down to |
types |
Matrix of specification assignments, of the same size as the first two dimensions
of |
patterns |
List of lists; each list is one specification for the arguments to |
title |
Main title |
side.label |
a character vector providing labels for the rows of the tableplot |
top.label |
a character vector providing labels for the columns of the tableplot |
table.label |
Whether to print row/column labels |
label.size |
Character size for labels |
side.rot |
Degree of rotation (positive for counter-clockwise) |
gap |
Width of the gap in each partition, if partitions are requested by |
v.parts |
An integer vector giving the number of columns in two or more partitions of the table. If provided, sum must equal number of columns. |
h.parts |
An integer vector giving the number of rows in two or more partitions of the table. If provided, sum must equal number of rows. |
cor.matrix |
Logical. |
var.names |
a list of variable names |
None. Used for its graphic side effect
The original version of tableplots was in the now-defunct tableplot package https://cran.r-project.org/package=tableplot. The current implementation is a modest re-design focused on its use for collinearity diagnostics, but usable in more general contexts.
Ernest Kwan and Michael Friendly
Kwan, E. (2008). Improving Factor Analysis in Psychology: Innovations Based on the Null Hypothesis Significance Testing Controversy. Ph. D. thesis, York University.
cellgram
data(cars)
cars.mod <- lm (mpg ~ cylinder + engine + horse + weight + accel + year,
data=cars)
car::vif(cars.mod)
(cd <- colldiag(cars.mod, center=TRUE))
tableplot(cd, title = "Tableplot of cars data", cond.max = 30 )
data(baseball, package = "corrgram")
baseball$Years7 <- pmin(baseball$Years,7)
base.mod <- lm(logSal ~ Years7 + Atbatc + Hitsc + Homerc + Runsc + RBIc + Walksc,
data=baseball)
car::vif(base.mod)
cd <- colldiag(base.mod, center=TRUE)
tableplot(cd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.