我有这些数据:
table(main$Sex1,main$District)
Bahawalnagar Barkhan Chiniot Faisalabad Ghotki
Female 37 16 26 97 46
Male 25 19 15 20 25
我可以使用基本的R语言绘制它。
barplot(table(main$Sex1,main$District))
所以我的问题是,如何使用ggplot2实现这一点?谢谢。
table
类已经很长了,它以一种特殊的方式打印。如果你使用as.data.frame
传递它,它会变得更长。 - iod