Heat map-like representation with colored cells
This function represents a two dimensional table plot in which cells are colored according with their value.
table.image(dftab, coordsx = 1:ncol(as.matrix(dftab)), coordsy = nrow(as.matrix(dftab)):1, labelsx, labelsy, nclass = 3, breaks = NULL, col = NULL, plot = TRUE, storeData = TRUE, add = FALSE, pos = -1, ...)
dftab |
a data frame, matrix, contingency table or distance matrix used to produce the plot |
coordsx |
an integer or a vector indicating the columns of |
coordsy |
an integer or a vector indicating the rows of |
labelsx |
columns labels |
labelsy |
rows labels |
breaks |
a vector of values to split |
nclass |
an integer for the number of desired intervals, ignored if |
col |
a color or a colors vector used for the cells |
plot |
a logical indicating if the graphics is displayed |
storeData |
a logical indicating if the data should be stored in
the returned object. If |
add |
a logical. If |
pos |
an integer indicating the position of the
environment where the data are stored, relative to the environment
where the function is called. Useful only if |
... |
additional graphical parameters (see
|
An object of class ADEg
(subclass T.image
) or ADEgS
(if add
is TRUE
).
The result is displayed if plot
is TRUE
.
Alice Julien-Laferriere, Aurelie Siberchicot aurelie.siberchicot@univ-lyon1.fr and Stephane Dray
tab <- as.table(matrix(rnorm(900), ncol = 30)) g1 <- table.image(tab) # add a continuous color bar as legend # update(g1, plegend.drawColorKey = TRUE) g2 <- table.image(tab, n = 100, coordsx = c(30, 1:29), plegend.drawKey = FALSE) data(rpjdl, package = "ade4") X <- data.frame(t(rpjdl$fau)) Y <- data.frame(t(rpjdl$mil)) coa1 <- ade4::dudi.coa(X, scannf = FALSE) g3 <- table.image(Y, coordsx = rank(coa1$co[, 1]), coordsy = 1:8, nclas = 5, labelsx = "", plegend.drawKey = FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.