0

Possible Duplicate:
Converting year and month to a date in R?

I have the following string:

date <- "Feb 1964"

I am trying to convert this to a date, using the following code:

new.date <- as.Date(date, format="%b %Y")

NA is returned here. Can someone kindly explain how I can achieve this, and explain what I am doing wrong ..

Many thanks in advance

Community
  • 1
  • 1
Sherlock
  • 5,557
  • 6
  • 50
  • 78

1 Answers1

2

I think this might do what you want.

date <- "Feb 1964"
date <- "1 Feb 1964"
new.date <- as.Date(date, format="%d %b %Y")
new.date
Mark Miller
  • 12,483
  • 23
  • 78
  • 132