geom_bar(position =" dodge")无效

时间:2017-05-26 09:16:48

标签: r ggplot2

我正在使用ggplot()进行一些练习,我想要想象下面的数据集:

Cultivar Date   Weight
c39     d16     3.18
c39     d20     2.80
c39     d21     2.74
c52     d16     2.26
c52     d20     3.11
c52     d21     1.47

它应该看起来像Pic1图 pic1

但是当我使用

ggplot(cabbage_exp, aes(x=Date, y=Weight,fill=Cultivar)) + 
  geom_bar(position = "dodge")

显示错误

  

错误:stat_count()不得与y美学一起使用。

geom_bar(stat=”identity”)工作正常(图2)Pic2

请建议:)

0 个答案:

没有答案