This function replaces the heatmap function in the stats package with a function with additional features. First, the user can specify an aspect ratio instead of being forced to accept a square image even when the matrix is not square. Second, the user can overlay horizontal or vertical lines to mark out important regions.
aspectHeatmap(x,
Rowv=NULL,
Colv=if (symm) "Rowv" else NULL,
distfun=dist,
hclustfun=hclust,
reorderfun=function(d, w) reorder(d, w),
add.expr,
symm=FALSE,
revC=identical(Colv, "Rowv"),
scale=c("row", "column", "none"),
na.rm=TRUE,
margins=c(5, 5),
ColSideColors,
RowSideColors,
cexRow=0.2 + 1/log10(nr),
cexCol=0.2 + 1/log10(nc),
labRow=NULL,
labCol=NULL,
main=NULL,
xlab=NULL,
ylab=NULL,
keep.dendro=FALSE,
verbose=getOption("verbose"),
hExp=1,
wExp=1,
vlines=NULL,
hlines=NULL,
lasCol=2,
…)
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
See documentation for heatmap.
height expansion factor (default is 1
)
width expansion factor (default is 1
)
vector of positions at which to draw vertical lines
vector of positions at which to draw horizontal lines
axis label style (las) for columns
additional arguments passed along to the image command
The same as the heatmap function.
The new arguments hExp
and wExp
are "expansion factors"
for the height and width of the figure, respectively. They are used
to alter the arguments passed to the layout function internally to
heatmap.
The new arguments hlines
and vlines
are used to specify
points at which horizontal or vertical lines, respectively, should be
overlaid on the image.
# NOT RUN {
nC <- 30
nR <- 1000
fakeData <- matrix(rnorm(nC*nR), ncol=nC, nrow=nR)
aspectHeatmap(fakeData, scale='none', hExp=2, wExp=1.4, margins=c(6,3))
aspectHeatmap(fakeData, scale='none', hExp=2, wExp=1.4, margins=c(6,3),
vlines=15.5, hlines=c(100, 300))
# }
Run the code above in your browser using DataLab