heatmap {tempmva}R Documentation

Draw a Heat Map

Description

A heat map is a false color image with a dendrogram added to the left side and to the top. Typically reordering of the rows and columns according to some set of values (row or column means) within the restrictions imposed by the dendrogram is carried out.

Usage

heatmap(x, Rowv, Colv, distfun = dist, add.expr,
        scale=c("row", "column", "none"), na.rm = TRUE, ...)

Arguments

x numeric matrix of the values to be plotted.
Rowv Either a dendrogram or a vector of values used to reorder the row dendrogram.
Colv Either a dendrogram or a vector of values used to reorder the column dendrogram.
distfun function used to compute the distance (dissimilarity) between both rows and columns. Defaults to dist.
add.expr expression that will be evaluated after the call to image. Can be used to add components to the plot.
scale character indicating if the values should be centered and scaled in either the row direction or the column direction, or none. The default is "row".
na.rm logical indicating whether NA's should be removed
... additional arguments passed on to image, e.g. col specifying the colors.

Details

If either Rowv or Colv are dendrograms they are honored (and not reordered). If either is a vector then the apropriate dendrogram is reordered according to the supplied values, subject to the constraints imposed by the dendrogram. If either is missing, as by default, then the ordering of the corresponding dendrogram is by the mean value of the rows/columns.

By default the rows are scaled to have mean zero and standard deviation one. There is some empirical evidence from genomic plotting that this is useful.

The default colors are not pretty. Consider using RColorBrewer.

Value

No value is returned. The function is called for the side effect of producing a picture.

Author(s)

Andy Liaw, original, R. Gentleman, revisions

See Also

image

Examples

  set.seed(132)
  x <- matrix(runif(1000), 50, 20)
  heatmap(x, col = topo.colors(32), main = "Random U[0,1] heatmap")

  data(volcano)
  ## Volcano is not recognizable, but at least not random
  heatmap(volcano, col = gray(0:64/64))

[Package Contents]