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?
Asked
Active
Viewed 24 times
0
![](../../users/profiles/9665197.webp)
Guilherme do Valle
- 87
- 1
- 10
2 Answers
1
Check ?strptime
, you can use :
as.Date("Sat Aug 15 1992","%a %b %d %Y")
#[1] "1992-08-15"
![](../../users/profiles/3962914.webp)
Ronak Shah
- 286,338
- 16
- 97
- 143
-
Thank you, you saved my morning. – Guilherme do Valle Mar 15 '21 at 13:39