[datatable-help] IDateTime and missing values

Farrel Buchinsky fjbuch at gmail.com
Tue Dec 29 01:27:17 CET 2015


By the way, as.IDate can handle the NA but IDateTime cannot.

On Mon, Dec 28, 2015 at 6:41 PM Farrel Buchinsky <fjbuch at gmail.com> wrote:

> 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)
>
-- 
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/20151229/ecdc1617/attachment.html>


More information about the datatable-help mailing list