我想使用 ggplot 或其他包在 R 中绘制一个图表,显示分类 Y 在数字 X 上的水平。
感谢您的帮助,并附上了Akseer 等人的示例图,其中包含我想要绘制的图表。.
这是重现此图的示例数据。
图 A 的数据:
Interventions<-c("CPR", "ANC 1+","ANC 4+", "SBA","Caesarian section",
"Early breastfeeding", "Exclusive breastfeeding at 6 months","BCG", "DTP3",
"OPV3", "Measles vaccine",
"Fully immunised", "Vitamin A+", "ORT",
"Pneumonia care", "Improved water",
"Sanitation")
Poorest<- (1/5)*(sample(1:100, 17, replace=TRUE))
Poorer<-(2/5)*(sample(1:100, 17, replace=TRUE))
Middle<-(3/5)*(sample(1:100, 17, replace=TRUE))
Richer<-(4/5)*(sample(1:100, 17, replace=TRUE))
Richest<-sample(1:100, 17, replace=TRUE)
mydata_A<-data.frame(Interventions, Poorest,Poorer, Middle, Richer, Richest)
rownames(mydata_A) <- mydata_A[,1]
dtFig3A<- mydata_A[,-1]