[datatable-help] IDateTime and missing values

Farrel Buchinsky fjbuch at gmail.com
Tue Dec 29 00:41:51 CET 2015


I have a data.table that contains real data. That means that some values
are missing. I am trying to convert one column into data.table's idate and
itime. Alas I am running into problems.

But look at this

*> IDateTime(as.POSIXlt(c("2015-05-01 13:46:23", "2015-05-03 16:40:00")))*
        idate    itime
1: 2015-05-01 13:46:23
2: 2015-05-03 16:40:00

*> IDateTime(as.POSIXlt(c("2015-05-01 13:46:23", "2015-05-03 16:40:00", NA
)))*
Error in if (any(neg)) res[neg] = paste("-", res[neg], sep = "") :
  missing value where TRUE/FALSE needed

A missing variable screws everything up. Any insights or suggestions for
me? At this point I will have to systematically select rows that meet
!is.na(datevariable)
to perform the IDateTime function on.


-- 
Farrel Buchinsky
(412) 567-7870 (gets me everywhere)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20151228/df2eb50a/attachment.html>


More information about the datatable-help mailing list