table.value: Heat map-like representation with proportional symbols

View source: R/T.value.R

table.valueR Documentation

Heat map-like representation with proportional symbols


This function represents a two dimensional table plot with proportional or colored squares or circles for each value.


table.value(dftab, coordsx = 1:ncol(as.matrix(dftab)), coordsy =
nrow(as.matrix(dftab)):1, labelsx, labelsy, breaks = NULL, method =
c("size", "color"), symbol = c("square", "circle", "diamond",
"uptriangle", "downtriangle"), col = NULL, nclass = 3, center = 0,
centerpar = NULL, plot = TRUE, storeData = TRUE, add = FALSE, pos = -1, ...)



a data frame, matrix, contingency table or distance matrix used to produce the plot


an integer or a vector indicating the columns of dftab kept


an integer or a vector indicating the rows of dftab kept


columns labels


rows labels


a vector of values to split dftab. If NULL, pretty(dftab, nclass) is used.


color or size value for represent z. If color, a palette of color is used for the symbols (one color per interval). If size, symbols of proportional area are used. Area is 0 for values equals to center (default 0). Two colors are used, for values less than center and larger than center.


value for symbol type


a color or a colors vector to color symbols. If method is size, a 2-length vector of color is expected. If method is color, it must have as many colors as the number of class


an integer for the number of desired intervals, ignored if breaks is not missing.


a center value for method size


a logical or a list to represent center value using elements in the adegpar("ppoints") list


a logical indicating if the graphics is displayed


a logical indicating if the data should be stored in the returned object. If FALSE, only the names of the data arguments are stored


a logical. If TRUE, the graphic is superposed to the graphics already plotted in the current device


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 storeData is FALSE


additional graphical parameters (see adegpar and trellis.par.get)


An object of class ADEg (subclass T.cont if dftab is an table object, otherwise subclass T.value) or ADEgS (if add is TRUE).
The result is displayed if plot is TRUE.


For the symbol size, if the method is size, we use perceptual scaling (Tanimura et al. 2006) .


Alice Julien-Laferriere, Aurelie Siberchicot and Stephane Dray


Tanimura, S. and Kuroiwa, C. and Mizota, T. 2006 Proportional symbol mapping in R Journal of Statistical Software 15, 1–7

See Also

T.value T.cont ADEg.T


## data.frame
data(olympic, package = "ade4")
w <- olympic$tab
w <- data.frame(scale(w))
wpca <- ade4::dudi.pca(w, scann = FALSE)
g1 <- table.value(w, ppoints.cex = 0.5, axis.line = list(col = "darkblue"), 
  axis.text = list(col = "darkgrey"))
# update the legend position
update(g1, key = list(space = "left"))
update(g1, key = list(columns = 1))

g2 <- table.value(w, coordsy = rank(wpca$li[, 1]), ppoints.cex = 0.5, 
  axis.line = list(col = "darkblue"), axis.text = list(col = "darkgrey"))
g3 <- table.value(w, coordsy = wpca$li[, 1], coordsx = wpca$co[, 1], ppoints.cex = 0.5, 
  axis.line = list(col = "darkblue"), axis.text = list(col = "darkgrey"))

## distance
g5 <- table.value(eurodist, symbol = "circle", 
  ptable.margin = list(bottom = 5, top = 16, left = 5, right = 16))

## Not run: 
## table
data(rpjdl, package = "ade4")
w <- data.frame(t(rpjdl$fau))
wcoa <- ade4::dudi.coa(w, scann = FALSE)
g6 <- table.value(as.table(as.matrix(w)), meanY = TRUE, coordsx = wcoa$c1[,1], 
  coordsy = rank(wcoa$l1[,1]), ppoints.cex = 0.2, labelsx = "", col = "black")

## End(Not run)

adegraphics documentation built on Oct. 13, 2023, 5:11 p.m.