R heatmap.2 One row heatmap with color key

耗尽温柔 提交于 2019-12-13 07:57:44

问题


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). The following is a link to the article: pnas.org/content/109/32/E2183/1

My effective data is just a column with values between -1 and 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.

Thanks.


回答1:


You can plot a heatmap of a one-column dataset with image:

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



来源:https://stackoverflow.com/questions/21769166/r-heatmap-2-one-row-heatmap-with-color-key

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!