This function utilizes
ggplot2 (Wickham, 2009) to
visualize a matrix as a heatmap: a false color plot in which the individual
matrix entries are represented by colors. lowColor
determines the
color scale for matrix entries in the negative range. highColor
determines the color scale for matrix entries in the positive range. For the
colors supported by the arguments lowColor
and highColor
, see
https://stat.columbia.edu/~tzheng/files/Rcolor.pdf. White entries in
the plot represent the midscale value of 0. One can opt to set the diagonal
entries to the midscale color of white when one is interested in
(heatmapping) the off-diagonal elements only. To achieve this, set
diag = FALSE
. Naturally, the diag
argument is only used when
the input matrix M
is a square matrix.
The intended use of the function is to visualize a, possibly sparsified,
precision matrix as a heatmap. The function may also be used, in a graphical
modeling setting, to assess the performance of edge selection techniques.
However, the function is quite general, in the sense that it can represent
any matrix
as a heatmap.