我遇到以下问题.我需要绘制3个因子变量和1个数值变量.
我的数据集:
Site,Gall,Status,Count
Site1,absent,unhealthy,35
Site1,absent,healthy,1750
Site1,present,unhealthy,23
Site1,present,healthy,1146
Site2,absent,unhealthy,146
Site2,absent,healthy,1642
Site2,present,unhealthy,30
Site2,present,healthy,333
Run Code Online (Sandbox Code Playgroud)
我尝试过使用ggplot,但是它只允许我定义x,y和另外一个选项,所以我使用了fill = Gall.
我的代码看起来如下,我仍然缺少一个因子变量.
ggplot(dat, aes(Status, Count, fill = Gall)) +
geom_bar(stat = "identity", position = "dodge")
Run Code Online (Sandbox Code Playgroud)
有人可以帮我吗?
谢谢,非常感谢