Display numeric content of matrix as image
To get a quick overview of the distribution of data and, in particular, of local phenomena it is useful to express numeric values as colored boxes.
Such an output can also be referred to as heatmap (note that the term 'hatmap' is also frequently associated with graphical display of hierarchcal clustering results).
The function image
provides the basic support to do so (ie heatmap without rearranging rows and columns by clustering).
To do this more conveniently, the function imageW
offers additional options for displaying row- and column-names or displaying NA-values as custom-color.
imageW( dat, col = NULL, rowNa = NULL, colNa = NULL, tit = NULL, xLab = NA, yLab = NA, cexXlab = 0.7, cexAxs = NULL, cexYlab = 0.9, cexTit = 1.6, NAcol = grDevices::grey(0.8), las = 2 )
dat |
(matrix or dtaa.frame) main input |
col |
(character or integer) colors, default is 60 shades 'RdYlBu' RColorBrewer, if 'heat.colors' use heat.colors in min 15 shades |
rowNa |
(character) optional custom rownames |
colNa |
(character) optional custom colnames |
tit |
(character) custom figure title |
xLab |
(character) optional custom names for x-axis |
yLab |
(character) optional custom names for y-axis |
cexXlab |
(numeric) cex-like expansion factor for x-axis labels (see also |
cexAxs |
(numeric) cex-like expansion factor for x- and y-axis text/labels (see also |
cexYlab |
(numeric) cex-like expansion factor for y-axis labels (see also |
cexTit |
(numeric) cex-like expansion factor for title (see also |
NAcol |
(character or integer) custom color fro NA-values, default is grey |
las |
(numeric) style of axis labels (see also |
If the main input dat
is numeric vector (an not matrix or data.frame) the values will be displayed as multiple columns and single row.
graphical output only
imageW(as.matrix(iris[1:40,1:4]))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.