我想在 value=NA 的单元格中填充 gray50 并在 value!=NA 的单元格中显示 dark2 中的值,如Palpacuer 等人的热图中所示。有人可以帮我吗?
这是我的数据和代码:
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)