0

I have a dataframe with a date column using a specific date pattern, where the format is "Sat Aug 15 1992", for example. I tried to use as.Date("Sat Aug 15 1992","%Y-%m-%d") but it returns only NA. How can I make R understand my column as a date?

2 Answers2

1

Try

as.Date("Sat Aug 15 1992",format="%Y-%m-%d")
noah1400
  • 49
  • 4
1

Check ?strptime, you can use :

as.Date("Sat Aug 15 1992","%a %b %d %Y")
#[1] "1992-08-15"
Ronak Shah
  • 286,338
  • 16
  • 97
  • 143