我的数据:
> d
ClientType Param4
1: A Type3
2: B Type3
3: A Type3
4: B Type3
5: A Type3
6: B Type2
7: A Type1
8: B Type2
9: A Type1
10: B Type2
11: A Type1
12: B Type2
13: A Type1
14: C Type2
我的代码是:
# plot for A
ggplot(data=subset(d, ClientType == "A"), aes(x = fct_rev(fct_infreq(Param4)), fill=Param4))
+geom_bar(position="dodge",fill="#3399FF")
+ theme_minimal()
+ coord_flip()
任何评论都可能有所帮助!谢谢!