Hi all,
Using the latest 1.6.4 with type="source" from R-Forge. The issue
seems to be with rbind on a data frame. Here's what happens:
> DT <- data.frame(x=as.IDate(rep("2010-01-01",10)), y=1:10)
> str(DT)
'data.frame': 10 obs. of 2 variables:
$ x:Classes 'IDate', 'Date' int [1:10] 14610 14610 14610 14610 14610
14610 14610 14610 14610 14610
$ y: int 1 2 3 4 5 6 7 8 9 10
> str(rbind(DT, DT))
'data.frame': 20 obs. of 2 variables:
$ x:Classes 'IDate', 'Date' num [1:20] 14610 14610 14610 14610 14610 ...
$ y: int 1 2 3 4 5 6 7 8 9 10 ...
If I take rbind(DT, DT), make it into a data table, and try to set the
key as x, it gives an error that x cannot be converted into integer
without losing some information. That is because as you see from the
str calls above, x turns from "Classes 'IDate', 'Date' int" to
"Classes 'IDate', 'Date' num".
Note that rbind(data.table(DT), data.table(DT)) works fine. So it is
the interaction between IDate and rbind.data.frame. Tried skimming
rbind.data.frame for any obvious things that stick out, but that is a
pretty inscrutable function.
Thoughts?
-Chris
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help