我嘗試使用R barplot功能繪製在同一張圖如下數組:情節對準barplots
ID 1 2 3 4 5 6 7 8
HeL 0 2 1 4 2 3 2 4
CaC 2 0 0 2 1 5 7 8
NIH 1 2 5 6 3 5 7 9
我需要有其自身的y各行的barplot軸,但所有行的x軸應該是通用的。到目前爲止,我所取得的成就,是從文件讀取「rna.tab」矩陣,然後分別繪製每一行:
dat <- read.table ("rna.tab", row.names=1, header=TRUE)
barplot (as.matrix (dat[,1]))
barplot (as.matrix (dat[,2]))
barplot (as.matrix (dat[,3]))
但我並沒有在策劃他們一起取得成功。 在此先感謝 - Arturo
'library(tidyverse); df%>%rownames_to_column('ID')%>%gather(var,val,-ID)%>%ggplot(aes(var,val,fill = ID))+ geom_bar(stat ='identity',position ='道奇')'? – alistaire