[datatable-help] fread: skip

Karl Ove Hufthammer karl at huftis.org
Sun May 12 17:39:50 CEST 2013


su. den 12. 05. 2013 klokka 16.20 (+0100) skreiv Matthew Dowle:
> For that I think all that needs to be done (now) is adding something 
> very similar to these few lines (from read.table) into fread at R
> level 
> after the data has been read in :
> 
>         if (colClasses[i] == "factor")
>             as.factor(data[[i]])
>         else if (colClasses[i] == "Date")
>             as.Date(data[[i]])
>         else if (colClasses[i] == "POSIXct")
>             as.POSIXct(data[[i]])

Any chance you could support the ‘tz’ attribute of ‘as.POSIXct’
(as a global value for all datetimes would probably be sufficient)?

By default, strings are interpreted as being in the locale timezone,
which means that some apperently valid datetimes are invalid (because of
DST), resulting in loss of information of the resulting POSIXct vectors.

See the following ‘not-a-bug’ for an explanation of the problem:
  https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14845

-- 
Karl Ove Hufthammer
http://huftis.org/
Jabber: karl at huftis.org



More information about the datatable-help mailing list