给出了以下数据集
df <- data.frame(ID = c("AA","BB","CC","AA","BB","CC","AA","BB","CC","AA","BB","CC","AA","BB","CC"), percentages = c(10.4,0.19,89.41,12.05,0.78,87.17,2.92,0.1,96.99,14.19,1.07,84.74,48.59,28.4,22.93), Antibodies= c("positive","positive","positive","positive", "positive","positive","positive","positive","negative","negative","negative","negative","negative", "negative","negative"), BB= c( "cardio1","cardio2", "cardio3","cardio1","cardio2", "cardio3", "cardio1", "cardio2", "cardio3", "cardio1", "cardio1", "cardio2","cardio3", "cardio1","cardio2"), stringsAsFactors = F)
我想在下图中绘制每个正负对的卡方值
ggplot(df,aes(x=Antibodies,y= percentages,fill=ID))+
geom_bar(stat = "identity",color="white")+
facet_wrap(~BB,nrow=1)
谢谢!