Skip to content

cbind speed.

2 messages · Charles Danko, Brian Ripley

#
cbind/ rbind/ data.frame functions are very convenient for merging
vectors of different types into a single data frame, but take quite a
bit of time to execute on larger data sets.

Is it possible to speed these up a bit?

What functions do you use instead?

Thanks & regards,
Charles
#
On Wed, 23 Apr 2008, Charles Danko wrote:

            
You would need to show us some examples and timings (and cbind and rbind 
are very different tasks).

Sometimes adding a single column by DF$new <- new_col is faster than 
cbind, and it is often faster to use matrices if you have purely numeric 
data (at least for rbind).

Also, what does this have to do with R-devel rather than R-help -- it is 
not about 'code development', 'programming' nor the development of R?
So please follow up there after re-reading the posting guide.