How to deal with “data of class uneval” error from ggplot2?

前端 未结 3 750
生来不讨喜
生来不讨喜 2020-11-30 23:37

While trying to overlay a new line to a existing ggplot I am getting the following error:

Error: ggplot2 doesn\'t know how to deal with data of class uneval         


        
3条回答
  •  佛祖请我去吃肉
    2020-12-01 00:30

    when you add a new data set to a geom you need to use the data= argument. Or put the arguments in the proper order mapping=..., data=.... Take a look at the arguments for ?geom_line.

    Thus:

    p + geom_line(data=df.last, aes(HrEnd, MWh, group=factor(Date)), color="red") 
    

    Or:

    p + geom_line(aes(HrEnd, MWh, group=factor(Date)), df.last, color="red") 
    

提交回复
热议问题