静态与交互式热图:
heatmap():用于绘制简单热图的函数
heatmap.2():绘制增强热图的函数
d3heatmap:用于绘制交互式热图的R包
ComplexHeatmap:用于绘制、注释和排列复杂热图的R&bioconductor包(非常适用于基因组数据分析)
- heatmap():
参数:
heatmap(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"), ...) - Arguments
x:
numeric matrix of the values to be plotted.
Rowv:
determines if and how the row dendrogram should be computed and reordered. Either a[dendrogram](http://127.0.0.1:30835/help/library/stats/help/dendrogram)
or a vector of values used to reorder the row dendrogram or[NA](http://127.0.0.1:30835/help/library/stats/help/NA)
to suppress any row dendrogram (and reordering) or by default,[NULL](http://127.0.0.1:30835/help/library/stats/help/NULL)
, see ‘Details’ below.
Colv:
determines if and how the column dendrogram should be reordered. Has the same options as theRowv
argument above andadditionally whenx
is a square matrix,Colv = "Rowv"
means that columns should be treated identically to the rows (and so if there is to be no row dendrogram there will not be a column one either).
distfun:
function used to compute the distance (dissimilarity) between both rows and columns. Defaults to[dist](http://127.0.0.1:30835/help/library/stats/help/dist)
.
hclustfun:
function used to compute the hierarchical clustering whenRowv
orColv
are not dendrograms. Defaults to[hclust](http://127.0.0.1:30835/help/library/stats/help/hclust)
. Should take as argument a result ofdistfun
and return an object to which[as.dendrogram](http://127.0.0.1:30835/help/library/stats/help/as.dendrogram)
can be applied.
reorderfun:
function(d, w)
of dendrogram and weights for reordering the row and column dendrograms. The default uses[reorder.dendrogram](http://127.0.0.1:30835/help/library/stats/help/reorder.dendrogram)
.
add.expr:
expression that will be evaluated after the call toimage
. Can be used to add components to the plot.
symm:
logical indicating ifx
should be treated symmetrically; can only be true whenx
is a square matrix.
revC:
logical indicating if the column order should be[rev](http://127.0.0.1:30835/help/library/stats/help/rev)
ersed for plotting, such that e.g., for the symmetric case, the symmetry axis is as usual.
scale:
character indicating if the values should be centered and scaled in either the row direction or the column direction, or none. The default is"row"
ifsymm
false, and"none"
otherwise.
na.rm:
logical indicating whetherNA
's should be removed.
margins:
numeric vector of length 2 containing the margins (see[par](http://127.0.0.1:30835/help/library/stats/help/par)(mar = *)
) for column and row names, respectively.
ColSideColors:
(optional) character vector of lengthncol(x)
containing the color names for a horizontal side bar that may be used to annotate the columns ofx
.
RowSideColors:
(optional) character vector of lengthnrow(x)
containing the color names for a vertical side bar that may be used to annotate the rows ofx
.
cexRow, cexCol:
positive numbers, used ascex.axis
in for the row or column axis labeling. The defaults currently only use number of rows or columns, respectively.
labRow, labCol:
character vectors with row and column labels to use; these default torownames(x)
orcolnames(x)
, respectively.
main, xlab, ylab:
main, x- and y-axis titles; defaults to none.
keep.dendro:
logical indicating if the dendrogram(s) should be kept as part of the result (whenRowv
and/orColv
are not NA).
verbose
logical indicating if information should be printed.
...
additional arguments passed on to[image](http://127.0.0.1:30835/help/library/stats/help/image)
, e.g.,col
specifying the colors.
网友评论