From ripley at stats.ox.ac.uk  Wed Apr 23 21:03:22 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 23 Apr 2008 20:03:22 +0100 (BST)
Subject: [Rd] cbind speed.
In-Reply-To: <8adccabf0804231116yb26e66bn2e8134297b34140@mail.gmail.com>
References: <8adccabf0804231116yb26e66bn2e8134297b34140@mail.gmail.com>
Message-ID: <alpine.LFD.1.10.0804231956410.8164@gannet.stats.ox.ac.uk>

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



[Rd] cbind speed.
Prof Brian Ripley