简体   繁体   English

R heatmap.2带颜色键的一排热图

[英]R heatmap.2 One row heatmap with color key

I'm new to R and i want to generate a one row heatmap from my data using heatmap.2 as reported in "Widespread dynamic DNA methylation in response to biotic stress", Figure 3C (Dowen et al., 2012). 我是R的新手,我想使用heatmap.2从我的数据生成单行热图,如“图3C中的宽动态DNA甲基化响应生物胁迫”中所述(Dowen等,2012)。 The following is a link to the article: pnas.org/content/109/32/E2183/1 以下是文章的链接:pnas.org/content/109/32/E2183/1

在此处输入图片说明

My effective data is just a column with values between -1 and 1: 我的有效数据只是一列,其值介于-1和1之间:

   deltaMeth
     -1
     -1
    -0.9
    -0.8
    -0.2
     0.3
     0.6
     0.7
     0.8
      1

My goal is to create a heatmap similar to the reported by (Dowen et al., 2012) using my dataset. 我的目标是使用我的数据集创建类似于(Dowen et al。,2012)报告的热图。

Thanks. 谢谢。

You can plot a heatmap of a one-column dataset with image : 您可以使用image绘制单列数据集的热图:

library(graphics)
mat <- matrix(c(-1, -1, -.9, -.8, -.2, .3, .6, .7, .8, 1))
image(mat)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM