I've got this dataframe from google.finance and I want the "Date" column to be in date format.
`read.csv("ual.csv", header = TRUE, stringsAsFactors = FALSE)?
head(Ual_df)
Date Open High Low Close Volume
1 19-May-17 76.42 78.34 76.18 77.98 4143616
2 18-May-17 76.32 77.18 75.62 75.98 3559591
3 17-May-17 78.06 78.63 75.94 76.18 5673018`
As you can see, the dates are a bit ambiguous, since the days and the years are in the same format. I did this:
Ual_df$Date <- as.Date(Ual_df$Date, "%Y-%m-%d")
and it returned NAs.
head(Ual_df)
Date Open High Low Close Volume
1 <NA> 76.42 78.34 76.18 77.98 4143616
2 <NA> 76.32 77.18 75.62 75.98 3559591
3 <NA> 78.06 78.63 75.94 76.18 5673018
I also tried to set the C locale but nothing changed.
Any suggestions ? Thank you.