[datatable-help] cbind doesn't work as expected

Timothée Carayol timothee.carayol at gmail.com
Tue Aug 9 10:55:15 CEST 2011


Hi -- I confirm that :=NULL for first column is not causing an error
anymore, at least in 1.6.4 rev 303.
Thanks!


On Tue, Aug 9, 2011 at 9:46 AM, Matthew Dowle <mdowle at mdowle.plus.com> wrote:
>
> Agreed. It's proving tricky to fix owing to the .Internal way that cbind
> dispatches. Please file as a bug.report.
>
> Please confirm all other bugs (in particular the crash with :=NULL) are
> fixed by 1.6.4, and all being well, will push 1.6.4 to CRAN tonight
> (including [<-.IDate if that's confirmed in time).
>
> Matthew
>
> "Chris Neff" <caneff at gmail.com> wrote in message
> news:CAAuY0RWrjhDfUj7eSikjjRXTwiFDVA-N0HvvOeViq0SWO4fmWw at mail.gmail.com...
>> cbind with a data table and data frame does... something.  I'm not
>> sure how else I would get these to cbind in quite this way.
>>
>>> DT <- data.table(x=1:10, y=1:10)
>>> DT
>>       x  y
>> [1,]  1  1
>> [2,]  2  2
>> [3,]  3  3
>> [4,]  4  4
>> [5,]  5  5
>> [6,]  6  6
>> [7,]  7  7
>> [8,]  8  8
>> [9,]  9  9
>> [10,] 10 10
>>> cbind(DT, data.frame(z=1:10, w=1:10))
>>  DT
>> x Integer,10 Integer,10
>> y Integer,10 Integer,10
>>
>>
>>
>> Note that doing it with a data.table works fine of course.
>>> cbind(DT, data.table(z=1:10, w=1:10))
>>       x  y  z  w
>> [1,]  1  1  1  1
>> [2,]  2  2  2  2
>> [3,]  3  3  3  3
>> [4,]  4  4  4  4
>> [5,]  5  5  5  5
>> [6,]  6  6  6  6
>> [7,]  7  7  7  7
>> [8,]  8  8  8  8
>> [9,]  9  9  9  9
>> [10,] 10 10 10 10
>>
>>
>> When cbind'ing a data.table to a data.frame, I think I would expect
>> the same behavior as doing data.table(DT, data.frame(z=1:10, w=1:10)).
>> I may be missing a subtelty there though.
>>
>> -Chris
>
>
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>


More information about the datatable-help mailing list