Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

imageW

Display numeric content of matrix as image


Description

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.

Usage

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
)

Arguments

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 par)

cexAxs

(numeric) cex-like expansion factor for x- and y-axis text/labels (see also par)

cexYlab

(numeric) cex-like expansion factor for y-axis labels (see also par)

cexTit

(numeric) cex-like expansion factor for title (see also par)

NAcol

(character or integer) custom color fro NA-values, default is grey

las

(numeric) style of axis labels (see also par)

Details

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.

Value

graphical output only

See Also

image, heatmaps including hierarchical clustering heatmap or heatmap.2 from gplots

Examples

imageW(as.matrix(iris[1:40,1:4]))

wrGraph

Graphics in the Context of Analyzing High-Throughput Data

v1.2.3
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.