[datatable-help] rbind behavior

Steve Lianoglou mailinglist.honeypot at gmail.com
Sun Oct 23 20:35:31 CEST 2011


I think he means that running data.frame.rbind on these:

R> d1 <- data.frame(a=1:10, b=11:20)
R> d2 <- data.frame(b=101:120, a=21:30)
R> rbind(d1, d2)

Will "cross ref" the "a" and "b" columns and stack them correctly on
top of each other.

Doing the same with two data.table will bind the two together, but
won't do the cross-ref. It just gives you a warning that the names
didn't match, but rbind's the first to the first, and the second to
the second (columns) anyway.

-steve

On Sun, Oct 23, 2011 at 2:19 PM, Matthew Dowle <mdowle at mdowle.plus.com> wrote:
> Hi. Not sure what you mean, example needed please. Is that with v1.7.1 now
> on CRAN? There has been some to and fro on chind/rbind in last few
> versions.
>
>> Hi Matthew,
>>
>> Not sure if this is planned or inadvertent, but rbind matches up named
>> columns with data.frames but doesn't with data.table (data.table does give
>> the friendly warning).
>>
>> Thanks as always for your excellent package,
>>
>> Damian
>>
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact


More information about the datatable-help mailing list