Skip to content
Prev 278826 / 398502 Next

Weird Excel Time Format

The suggestions you have received about using CSV files to transfer data from Excel are useful, and in this case would have shown up a problem in the dates.  If you look at item 30 in rawtimeColumn, i.e. rawtimeColumn[30] you will see the value 14:5730.  This is not a valid numeric (nor date) value so rawtimeColumn was coerced to factor.  By using as.numeric(rawtimeColumn), you were not converting the factor levels to dates, but the rather the underlying factor integer representation (i.e. 1,2,3 ...) to dates. Since, '14:5730' appears to be smallest value in "lexical" ordering, it has an underlying value of 1, and you can see it was converted to '1904-01-02', the day after the origin (which is day 0).

Hope this is helpful,

Dan    

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204