How to create a heatmap in R- one row at a time?

末鹿安然 提交于 2020-01-05 18:57:29

问题


I'm new to R and am trying to generate a heatmap as part of a pipeline that will later on associate the heatmap with metabolic pathways. I have data in an excel file in the following form:

         tissue1   tissue2  tissue3  ...  
gene1          5         3        1  
gene2        120       400       70  
gene3          0         3        0  
...

My goal is to have some kind of a function or method I can call and it will only generate a heat map for the appropriate row, something like heatmap(gene2). I have roughly 800 rows. I want each heatmap to have an independent scale (indep on the other rows) Is it possible?

Thanks! :)


回答1:


with artificial data, if this is what you want.

x=matrix(abs(rnorm(100))*100,10,10,)
image(as.matrix(x[1,]))


来源:https://stackoverflow.com/questions/21538876/how-to-create-a-heatmap-in-r-one-row-at-a-time

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