繁体   English   中英

在R中创建热图/热图以获取年度数据

[英]Creating a Heatmap / Heatmaply in R for yearly data

跟踪热问题为R中的年度数据创建热图/订购列

热图

热图2

  1. 行名会更改,但是我的数据不会随之更改,请问关于如何使各行数据随其名称一起移动的问题是否可以寻求帮助?

  2. 有没有一种更容易的方法来使图形/ png变宽,因为我一直在纠缠边距,而我似乎要做的就是使其变窄。

  3. 我附加了第二张图像,以显示当我突出显示某个特定的单元格(例如1月的皮肤疾病)时,该值与.csv文件中的值不同,对吗? (看到颜色匹配,我应该随它一起跑吗?)

    库(heatmaply)x <-read.csv(“ Heatmap.csv”,check.names = FALSE)

     rownames(x) <- c('All Others', 'Circulatory Diseases', 'Digestive Diseases', 'Ear Diseases', 'Endocrine/Metabolic','Eye Diseases', 'Genitourinary Diseases', 'Ill-defined Condition', 'Infectious & Parasitic', 'Injury/ Poisoning', 'Mental & Behavioural', 'Musculoskeletal', 'Neoplasms', 'Nervous System', 'Pregnancy/Childbirth', 'Respiratory', 'Skin Diseases') x <- x[,2:13, drop=FALSE] x <- as.matrix(scale(x)) heatmaply(x,colors = heat.colors(200), k_col =1, k_row = 2, dendrogram = FALSE, margins = c(100, 160), scale_fill_gradient_fun = ggplot2::scale_fill_gradient2(low = "blue", high = "red", midpoint = 50, limits = c(0, 100))) 

暂无
暂无

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

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