Converting year and month (“yyyy-mm” format) to a date?

后端 未结 7 958
自闭症患者
自闭症患者 2020-11-21 04:55

I have a dataset that looks like this:

Month    count
2009-01  12
2009-02  310
2009-03  2379
2009-04  234
2009-05  14
2009-08  1
2009-09  34
2009-10  2386
         


        
7条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-21 05:35

    Using anytime package:

    library(anytime)
    
    anydate("2009-01")
    # [1] "2009-01-01"
    

提交回复
热议问题