0

I have this dataset:

201601
201602
201603

Is there anyway I can read this items as Date?

So far I've tried as.Date("201602",format = "%Y%m") but I gets NA

capm
  • 1,017
  • 3
  • 18
  • 24
  • You might want to add date as well to make it as actual date. `as.Date(paste0("201602", "01"),format = "%Y%m%d")`. – Ronak Shah Jun 24 '17 at 06:53
  • 1
    Possible duplicate of [Converting year and month ("yyyy-mm" format) to a date?](https://stackoverflow.com/questions/6242955/converting-year-and-month-yyyy-mm-format-to-a-date) Or [Format Date (Year-Month) in R](https://stackoverflow.com/questions/21916503/format-date-year-month-in-r) Or [Convert month year to a date in r](https://stackoverflow.com/questions/26697399/convert-month-year-to-a-date-in-r) – Ronak Shah Jun 24 '17 at 06:55
  • I did that, I was hoping for another solution. – capm Jun 24 '17 at 06:55
  • Go through the links shared, that might be helpful. – Ronak Shah Jun 24 '17 at 06:57
  • Try package anytime – Jeppe Olsen Jun 24 '17 at 10:03

0 Answers0