Gplots Heatmap

inmotionblackjack
8 min readNov 8, 2021

>>> Register here <<<

  1. Gplots Heatmap Example
  2. Gplots Heatmap.2
  3. Gplots Heatmap R

Gplots::heatmap.2 heatmaps with the type = heatmap argument. Superheat::superheat heatmap building package that I use frequently. Ggplot2::geomtile heatmap from tidy data (if you don’t know about tidy data, no. In heatmap.2, when the row or column trace is enabled, show the corresponding reference line in the color key. In heatmap.2, a new ‘extrafun’ argument is provided that allows the user to specify a.

heatmap.2 {gplots}R Documentation

Enhanced Heat Map

Description

A heat map is a false color image (basically image(t(x))) with a dendrogram added to the left side and/or to the top. Typically, reordering of the rows and columns according to some set of values (row or column means) within the restrictions imposed by the dendrogram is carried out.

This heatmap provides a number of extensions to the standard R heatmap function.

Usage

Arguments

x

numeric matrix of the values to be plotted.

Rowv

determines if and how the row dendrogram should be reordered. By default, it is TRUE, which implies dendrogram is computed and reordered based on row means. If NULL or FALSE, then no dendrogram is computed and no reordering is done. If a dendrogram, then it is used 'as-is', ie without any reordering. If a vector of integers, then dendrogram is computed and reordered based on the order of the vector.

Colv

determines if and how the column dendrogram should be reordered. Has the options as the Rowv argument above and additionally when x is a square matrix, Colv = 'Rowv' means that columns should be treated identically to the rows.

distfun

function used to compute the distance (dissimilarity) between both rows and columns. Defaults to dist.

hclustfun

function used to compute the hierarchical clustering when Rowv or Colv are not dendrograms. Defaults to hclust.

dendrogram

character string indicating whether to draw ‘none’, ‘row’, ‘column’ or ‘both’ dendrograms. Defaults to ‘both’. However, if Rowv (or Colv) is FALSE or NULL and dendrogram is ‘both’, then a warning is issued and Rowv (or Colv) arguments are honoured.

symm

logical indicating if x should be treated symmetrically; can only be true when x is a square matrix.

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' if symm false, and 'none' 2021 slots in vegas. otherwise.

na.rm

logical indicating whether NA's should be removed.

revC

logical indicating if the column order should be reversed for plotting, such that e.g., for the symmetric case, the symmetry axis is as usual.

add.expr

expression that will be evaluated after the call to image. Can be used to add components to the plot. Q casino and hotel yuma casino.

breaks

(optional) Either a numeric vector indicating the splitting points for binning x into colors, or a integer number of break points to be used, in which case the break points will be spaced equally between min(x) and max(x).

symbreaks

Boolean indicating whether breaks should be made symmetric about 0. Defaults to TRUE if the data includes negative values, and to FALSE otherwise.

col

colors used for the image. Defaults to heat colors (heat.colors).

colsep, rowsep, sepcolor

(optional) vector of integers indicating which columns or rows should be separated from the preceding columns or rows by a narrow space of color sepcolor.

sepwidth

(optional) Vector of length 2 giving the width (colsep) or height (rowsep) the separator box drawn by colsep and rowsep as a function of the width (colsep) or height (rowsep) of a cell. Defaults to c(0.05, 0.05)

cellnote

(optional) matrix of character strings which will be placed within each color cell, e.g. p-value symbols.

notecex

(optional) numeric scaling factor for cellnote items.

notecol

(optional) character string specifying the color for cellnote text. Defaults to 'green'.

na.color

Color to use for missing value (NA). Defaults to the plot background color.

trace

character string indicating whether a solid ‘trace’ line should be drawn across ‘row’s or down ‘column’s, ‘both’ or ‘none’. The distance of the line from the center of each color-cell is proportional to the size of the measurement. Defaults to ‘column’.

tracecol

character string giving the color for ‘trace’ line. Defaults to ‘cyan’.

hline, vline, linecol

Vector of values within cells where a horizontal or vertical dotted line should be drawn. The color of the line is controlled by linecol. Horizontal lines are only plotted if trace is 'row' or 'both'. Vertical lines are only drawn if trace 'column' or 'both'. hline and vline default to the median of the breaks, linecol defaults to the value of tracecol.

margins

numeric vector of length 2 containing the margins (see par(mar= *)) for column and row names, respectively.

ColSideColors

(optional) character vector of length ncol(x) containing the color names for a horizontal side bar that may be used to annotate the columns of x.

RowSideColors

(optional) character vector of length nrow(x) containing the color names for a vertical side bar that may be used to annotate the rows of x.

cexRow, cexCol

positive numbers, used as cex.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 to rownames(x) or colnames(x), respectively.

srtRow, srtCol

angle of row/column labels, in degrees from horizontal

adjRow, adjCol

2-element vector giving the (left-right, top-bottom) justification of row/column labels (relative to the text orientation).

offsetRow, offsetCol

Number of character-width spaces to place between row/column labels and the edge of the plotting region. Scatter plot iplot.

key

logical indicating whether a color-key should be shown.

keysize

numeric value indicating the size of the key

density.info

character string indicating whether to superimpose a ‘histogram’, a ‘density’ plot, or no plot (‘none’) on the color-key.

denscol

character string giving the color for the density display specified by density.info, defaults to the same value as tracecol.

symkey

Boolean indicating whether the color key should be made symmetric about 0. Defaults to TRUE if the data includes negative values, and to FALSE otherwise.

densadj

Numeric scaling value for tuning the kernel width when a density plot is drawn on the color key. (See the adjust parameter for the density function for details.) Defaults to 0.25.

main, xlab, ylab

main, x- and y-axis titles; defaults to none.

lmat, lhei, lwid

visual layout: position matrix, column height, column width. See below for details

..

additional arguments passed on to image

Details

If either Rowv or Colv are dendrograms they are honored (and not reordered). Otherwise, dendrograms are computed as dd <- as.dendrogram(hclustfun(distfun(X))) where X is either x or t(x).

If either is a vector (of “weights”) then the appropriate
dendrogram is reordered according to the supplied values subject to
the constraints imposed by the dendrogram, by reorder(dd,
Rowv)
, in the row case.

If either is missing, as by default, then the ordering of the
corresponding dendrogram is by the mean value of the rows/columns,
i.e., in the case of rows, Rowv <- rowMeans(x, na.rm=na.rm).

If either is NULL, no reordering will be done for
the corresponding side.

If scale='row' the rows are scaled to have mean
zero and standard deviation one. There is some empirical evidence
from genomic plotting that this is useful.

Colors

The default colors range from red to white (heat.colors) and
are not pretty. Consider using enhancements such
as the RColorBrewer package,
http://cran.r-project.org/src/contrib/PACKAGES.html#RColorBrewer
to select better colors.

By default four components will be displayed in the plot. At the top
left is the color key, top right is the column dendogram, bottom left
is the row dendogram, bottom right is the image plot. When
RowSideColor or ColSideColor are provided, an additional row or column
is inserted in the appropriate location. This layout can be
overriden by specifiying appropriate values for lmat,
lwid, and lhei. lmat controls the relative
postition of each element, while lwid controls the column
width, and lhei controls the row height. See the help page for
layout for details on how to use these
arguments.

Value

Invisibly, a list with components

rowInd

row index permutation vector as returned by
order.dendrogram.

colInd

column index permutation vector.

call

the matched call

rowMeans, rowSDs

mean and standard deviation of each row: only
present if scale='row'

colMeans, colSDs

mean and standard deviation of each column: only
present if scale='column'

carpet

reordered and scaled ‘x’ values used generate the main
‘carpet’

rowDendrogram

row dendrogram, if present

colDendrogram

column dendrogram, if present

breaks

values used for color break points

col

colors used

vline

center-line value used for column trace, present only if
trace='both' or trace='column'

hline

center-line value used for row trace, present only if
trace='both' or trace='row'

colorTable

A three-column data frame providing the lower and upper
bound and color for each bin

Note

The original rows and columns are reordered in any case to
match the dendrogram, e.g., the rows by
order.dendrogram(Rowv) where Rowv is the
(possibly reorder()ed) row dendrogram.

heatmap.2() uses layout and draws the
image in the lower right corner of a 2x2 layout.
Consequentially, it can not be used in a multi column/row
layout, i.e., when par(mfrow= *) or (mfcol= *)
has been called.

Author(s)

Andy Liaw, original; R. Gentleman, M. Maechler, W. Huber,
G. Warnes, revisions.

See Also

hclust

R gplots heatmap.2

Examples

http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/gplots/html/heatmap.2.html

Gplots Heatmap

http://bbsunchen.iteye.com/blog/1271580

heatmap.2的更多相关文章

Gplots Heatmap.2

  1. 基于HTML5实现3D热图Heatmap应用
  2. Heatmap热图通过众多数据点信息,汇聚成直观可视化颜色效果,热图已广泛被应用于气象预报.医疗成像.机房温度监控等行业,甚至应用于竞技体育领域的数据分析. http://www.hightopo.c ..
  3. 【JS】heatmap.js v1.0 到 v2.0,详细总结一下:)
  4. 前段时间,项目要开发热力图插件,研究了heatmap.js,打算好好总结一下. 本文主要有以下几部分内容: 部分源码理解 如何迁移到v2.0 v2.0官方文档译文 关于heatmap.js介绍,请看这 ..
  5. funsioncharts的图表操作heatmap
  6. 网址:http://www.fusioncharts.com/dev/chart-guide/heat-map-chart/introduction.html 以下只是假数据,目前还没有实现动态数据获 ..
  7. 用Excel制作热图(heatmap)的方法
  8. http://jingyan.baidu.com/article/64d05a0240ec75de55f73bd8.html 利用Excel 2010及以上版本的’条件格式’ — & ..
  9. Heatmap.js v2.0 — 最强大的 Web 动态热图
  10. Heatmap 是用来呈现一定区域内的统计度量,最常见的网站访问热力图就是以特殊高亮的形式显示访客热衷的页面区域和访客所在的地理区域的图示.Heatmap.js 这个 JavaScript 库可以实现 ..
  11. R实战之热点图(HeatMap)
  12. 快速实现是搜索帮助文档的首要目的,所以此处涉及实战的文章一概略去传统帮助文档的理论部分,直接上代码加注释! 本文将介绍R语言下利用ggplot2包制作heatmap的代码 — — — — — — — ..
  13. 基于HTML5实现的Heatmap热图3D应用
  14. Heatmap热图通过众多数据点信息,汇聚成直观可视化颜色效果,热图已广泛被应用于气象预报.医疗成像.机房温度监控等行业,甚至应用于竞技体育领域的数据分析. 已有众多文章分享了生成Heatmap热图原 ..
  15. 网页热力图 heatmap js
  16. HBuilder +js 实现网页热力图 废话不多说,上代码 <!DOCTYPE html> <html> <head> <title>111</ ..
  17. Leaflet+heatmap实现离线地图加载和热力图应用
  18. 本人博客主页:http://www.cnblogs.com/webbest/ 2017年春节已经过完,新一年的奋斗也刚刚开始.今年要经历的挑战也是大大的..不扯了. 年底前软件项目相对较多,恰巧在年 ..

随机推荐

Gplots Heatmap R

  1. PHP资源列表
  2. 一个PHP资源列表,内容包括:库.框架.模板.安全.代码分析.日志.第三方库.配置工具.Web 工具.书籍.电子书.经典博文等等. 初始翻译信息来自:<推荐!国外程序员整理的 PHP 资源大全& ..
  3. 知乎一道前端面试题详解,关于this的使用
  4. 请说明要输出正确的myName的值要如何修改程序?并解释原因 foo = function(){ this.myName = ‘Foo function.’; } foo.prot ..
  5. JS 生成GUID 方法
  6. var Guid={NewGuid: function () { var guid = (this._G() + this._G() +’-’+ this._G() +’ ..
  7. 不知道数据库中表的列类型的前提下,使用JDBC正确的取出数据
  8. 概要: 使用jdbc 如果在不知道表结构的情况下,如何读出表信息? 使用ResultSetMetaData; 然后使用getColumnType 获取column 类型 使用getColumnName ..
  9. 洛谷P1136 迎接仪式
  10. 题目描述 LHX教主要来X市指导OI学习工作了.为了迎接教主,在一条道路旁,一群Orz教主er穿着文化衫站在道路两旁迎接教主,每件文化衫上都印着大字.一旁的Orzer依次摆出“欢迎欢迎欢迎欢迎……”的 ..
  11. 问 如何使用css将select的边框以及右边的小三角形去掉?
  12. 最好css2,css3都给出解决方案,效果如下: CSS2 只能使用div和ul进行模拟了,结构很简单,具体可参考Alice的 button-dropdownCSS3 可以使用CSS3的属性appea ..
  13. CentOS 7上VNCServer的安装使用
  14. 1.安装 yum install tigervnc tigervnc-server 2.配置 vncserver的配置,创建一个新的配置文件 cp /lib/systemd/system/vncser ..
  15. Confluence 6 从外部小工具中注册访问
  16. 希望从 Confluence 中删除一个小工具,你可以选择小工具边上的 URL ,然后单击删除(Delete). 如果你希望取消订阅一个应用的小工具,你需要删除整个订阅.你不能仅仅删除你订阅中的某一个 ..
  17. resttemplate 文件上传 上传文件
  18. springmvc RestTemplate文件上传 RestTemplate上传文件总结
  19. 解决VS2013中的控制台一闪而过的问题
  20. 修改项目配置,右键点击项目,在右键菜单中选择属性,然后在弹出的对话框左侧列表中中选择 “配置属性” →“链接器” →“系统”,然后在右侧的列表中, 在第一项”子系统“的值中选择”控制台 ..

>>> Register here <<<

--

--