I had problem in specifying the date format of my data arranged as:
Date Longitude Latitude Elevation Max Temperature Min Temperature Precipitation Wind Relative Humidity Solar
1/1/1979 40.625 10.1473999 594 31.784 14.711 0 1.34012963 0.332977248 23.69273112
1/2/1979 40.625 10.1473999 594 30.548 15.001 0 1.440527678 0.445704584 23.2192062
1/3/1979 40.625 10.1473999 594 30.029 18.724 0.020599366 1.950813349 0.532062642 18.34447248
1/4/1979 40.625 10.1473999 594 31.311 17.802 0 2.150911946 0.466495869 23.07077748
i tried using as.Date but the result is as follows:
gewane_t$Date <- as.Date(gewane_t$Date,format("%m/%d/%Y"))
Error in charToDate(x) : character string is not in a standard unambiguous format
any solution.
kind regards,
as.Date(gewane_t$Date, format("%m/%d/%Y")
tryas.Date(gewane_t$Date, format = "%m/%d/%Y")
. – ricoderksgewane_t$Date
is numerical. From the table above and your error message I would suggest it is a character string. Was this file open in Excel and saved? Excel shows a date, but in the background it is just a number. – ricoderkscsv
file then it will be saved as a number (i.e. number of days as of 01-01-1900 on Windows machine and 01-01-1904 on Mac machine). You can try:as.Date(gewane_t$Date, origin = "1900-01-01")
– ricoderks