\HeaderA{groupedHeatmap}{Heatmap of a matrix with grouped rows and columns}{groupedHeatmap}
\begin{Description}\relax
The function uses \code{\LinkA{grid.rect}{grid.rect}}
and \code{\LinkA{grid.rect}{grid.rect}} to draw a heatmap with grouped rows and columns.
\end{Description}
\begin{Usage}
\begin{verbatim}
groupedHeatmap(z, frow, fcol,
  fillcolours = c("#2166ac","#4393c3","#92c5de","#d1e5f0","#fefefe","#fddbc7","#f4a582","#d6604d","#b2182b"),
  bordercolour = "#e0e0e0",
  zlim = range(z, na.rm=TRUE))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{z}] A matrix with row and column names.
\item[\code{frow}] A \code{factor} of length \code{nrow(z)} indicating the
row grouping.
\item[\code{fcol}] A \code{factor} of length \code{ncol(z)} indicating the
column grouping.
\item[\code{fillcolours}] A \code{character} vector of colours from which the
colour map is obtained through interpolation.
\item[\code{bordercolour}] Either a \code{character} vector of length 1,
specifying the border colour of the heatmap tiles, or \code{NULL} or
\code{NA}, which indicates that the border colour should match the
fill colour.
\item[\code{zlim}] Lower and upper limit of \code{z} values represented in the colour
map.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function can be called within other drawing operations
from the grid package, e.g. within a viewport.
\end{Details}
\begin{Value}
The function is called for its side effect, drawing text and
rectangles on the current viewport.
\end{Value}
\begin{Author}\relax
Wolfgang Huber \url{http://www.ebi.ac.uk/huber}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{grid.text}{grid.text}}, \code{\LinkA{grid.rect}{grid.rect}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

data("mtcars")

groupedHeatmap(
  scale(mtcars),
  frow = factor(sapply(strsplit(rownames(mtcars), " "), "[", 1)),
  fcol = factor(round(seq_len(ncol(mtcars))/3)))
\end{ExampleCode}
\end{Examples}

