Skip to content
Prev 278996 / 398502 Next

efficient ways to dynamically grow a dataframe

First, dataframes can be much slower than matrices, for example, if
you are changing/accessing values a lot.  I would suggest that you use
a matrix since is seems that all your values are numeric.  Allocate a
large empty matrix to start (hopefully as large as you need).  If you
exceed this, you have the option of 'rbind'ing more empty rows on and
continuing.  This might depend on how large your final matrix might be
(you did not state the boundary conditions).

On Thu, Dec 1, 2011 at 6:34 AM, Matteo Richiardi
<matteo.richiardi at unito.it> wrote: