I was reading in a .csv file into R, where the .csv file was originally saved in Excel format.
While preparing for the .csv file, i did a copy and paste of the content on a new spreadsheet, and the Date.Sold
variable was formatted as "general" in Excel.
I am curious as to why applying the command as.Date()
on "general" formatted date values (from Excel) can't work in R? It gives me a series of NA values. If I had formatted the Date.Sold
variable into "date" in Excel before reading into R, the as.Date()
command works fine. Why is this so? Is there any way to read these "general" formatted variables into proper dates in R?
Some information about my variable and the command I used:
Str(Date.Sold): $ Date.Sold : Factor w/ 789 levels "-","40965.00",..: 461 463 456 17
Command that I used:
A$Date = as.Date(A$Date.Sold, "%d/%m/%Y")