如何在value = NA的单元格中填充grey50,并使用heatmaply在热图中显示值!= NA的单元格中的值?

时间:2017-11-10 04:57:37

标签: r plotly heatmaply

我想在值= NA的单元格中填充grey50,并在单元格中的dark2中显示值,其中值!= NA,如heatmap中的Palpacuer et al。有人可以帮帮我吗?

以下是我的数据和代码:

T<-c("Pla", "Ond","Gra", "Dol","Tro", "Ond+Dex", "Pal","Ram", "Ond+Drop",  "Ond+Met", "Gra+Dex",  "Pal+Dex", "Dol+Dex", "Dol+Drop", "Gran+Drop")
S1<- c(42.8, 54.6, 40.7, 81.5, 54.6, 83.3, NA, 35.3, NA, NA, 2.9, NA, NA, 54.2, NA)
S2<-c(51.9, 64.9, 93.5, 27.7, 35.3, NA, NA, NA, NA, NA, NA, NA, 26.6, NA, NA)
S3<-c(0.8, 25.4, 44.8, 13.3, 23.2, 71.9, 54.9, 51.3, 65.4, 52.8, 81.2, 43.7, 72.8, 76.8, 71.7)
S4<-c(4.6, 29.4, 54.3, 22, 42.2, 76, 30.1, 48.4, 84.6, 78.8, 84.3, 7.8, 73.9, 68.8, 44.8)
S5<-c(0.1, 20.1, 42.5, 37.7, 16.3, 63, 72.3, 34.9, 76.9, NA, 86.3, 67, NA, 71.9, 61.1)
mydata<-data.frame(T, S4, S3, S5, S2, S1)
rownames(mydata) <- mydata[,1]
mydata <- mydata[,-1]
heatmaply(mydata)

1 个答案:

答案 0 :(得分:0)

谢谢,这是hotmaply中的错误,这是由于剧情中的错误。

这是由于剧情中的错误:

https://github.com/ropensci/plotly/issues/1149

这导致了hotmaply中的这个错误:

https://github.com/talgalili/heatmaply/issues/122