在R中为年度数据创建Heatmap / Heatmaply

时间:2017-06-29 14:39:09

标签: r matrix heatmap heatmaply

跟进热图问题Creating a heatmap / ordering columns for yearly data in R

Heatmaply

Heatmaply2

  1. rownames发生了变化,但我的数据没有随之变化,我可以请求任何有关如何让每一行数据随其名称移动的帮助吗?

  2. 是否有一种更简单的方法可以让图形/ png变得更宽,因为我一直在搞乱边距,而我似乎所做的就是让它更窄。

  3. 我附加了第二张图片,以便在我突出显示特定细胞时显示1月的皮肤病与.csv文件中的皮肤疾病的价值不同,这是对的吗? (看起来颜色匹配我应该用它运行吗?)

    库(heatmaply)     x< -read.csv(" Heatmap.csv&#34 ;, 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)))
    

0 个答案:

没有答案