Quantcast
Channel: date format change when year is an one digit number - Stack Overflow
Viewing all articles
Browse latest Browse all 3

date format change when year is an one digit number

$
0
0

I have a df with a date column (year month) like this: 7-Feb, 7-March ( meaning February 2007, March 2007 etc). I want to make it like this 2007-02, 2007-03 etc. I tried to solve it by this code

as.Date(df$date,format="%y-%b")

But it produces na na ...

As a new learner of r, could you help me in this regard?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images