1

I've imported and xlsx file and I have a column of dates as characters:

Jan 08
Feb 08
Mar 08
Apr 08

etc...

I want to convert this column into dates. I've tried some suggestions I've seen on other threads but I can't get it to not return NA

Here's the latest attempt:

dates <- format(as.Date(MonthlyUKFigures$Date,format="%b-%y"),format="%b-%y")
Teebs
  • 11
  • 1
  • I think this will anser your question: https://stackoverflow.com/questions/41122645/lubridate-how-to-parse-month-year – tivd Feb 13 '22 at 22:46

1 Answers1

1

You can simply use lubridate package:

my("Jan 08")
[1] "2008-01-01"
Bloxx
  • 1,495
  • 1
  • 9
  • 21