cumulative plot using ggplot2

后端 未结 3 1293
梦如初夏
梦如初夏 2020-12-15 23:38

I\'m learning to use ggplot2 and am looking for the smallest ggplot2 code that reproduces the base::plot result below. I\'ve tried a f

3条回答
  •  天涯浪人
    2020-12-16 00:08

    After a couple of years, I've settled on doing:

    ggplot(df, aes(as.Date(as.character(date), '%Y%m%d'), cumsum(val))) + geom_line()
    

提交回复
热议问题