Modifying Plot in ggplot2 using as.yearmon from zoo

后端 未结 1 1307
心在旅途
心在旅途 2020-12-18 08:39

I have created a graph in ggplot2 using zoo to create month bins. However, I want to be able to modify the graph so it looks like a standard ggplot graph. This means that th

相关标签:
1条回答
  • 2020-12-18 08:56

    To get a "standard-looking" plot, convert the data to a "standard" data type, which is a factor:

    ggplot(testset, aes(as.factor(as.yearmon(Date)), fill=Action)) + 
        geom_bar(position='dodge') 
    

    enter image description here

    0 讨论(0)
提交回复
热议问题