Convert numeric to date

前端 未结 2 532

I\'d like to convert this type of numeric values to a date but it doesn\'t work.

20100727 for instance

I tried to convert the numeric to charact

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 23:13

    You were setting wrong order of month and date values (in your code was Year, Date, Month, should be Year, Month, Date).

    as.Date("20100727", "%Y%m%d")
    [1] "2010-07-27"
    

提交回复
热议问题