# The rbinding race: for vs. do.call vs. rbind.fill

**Rcrastinate**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Which function rbinds dataframes together fastest?

First competitor: classic rbind in a for loop over a list of dataframes

Second competitor: do.call(“rbind”, )

Third competitor: rbind.fill()

from the plyr package

The job:

– rbinding a list of dataframes with 4 columns each, one column is the splitting factor, the other 3 hold normally distributed random data

– the number of rows of the original dataframe is varied between 20,000; 50,000; 100,000; 200,000; 300,000; 400,000; 500,000 and 600,000 rows

– the number of levels for the splitting factor (hence the number of list elements after splitting) is varied between 6, 12 and 24 – the total number of rows for the original dataframe is held constant

The machine:

– A blazing fast late 2008 MacBook with a 2 GHz CPU and 4 GBs of RAM running Mountain Lion

– 32-bit R using RGui.app for Mac OS X

The results:

Adapt the creation procedure of df for the different number of sub-dataframes…

**leave a comment**for the author, please follow the link and comment on their blog:

**Rcrastinate**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.