[Rd] cbind speed.

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Apr 23 21:03:22 CEST 2008


On Wed, 23 Apr 2008, Charles Danko wrote:

> 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?

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.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list