[R] Loops and memory

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue May 6 21:30:22 CEST 2003


On Tue, 6 May 2003, R A F wrote:

> I'm afraid that I don't have your new book with Venables handy.  So
> would it be fair to assume that there's no real need to avoid loops
> these days?

No, but the issues are different from those in 1996.  It is a lot less 
common to have to avoid loops, simply because memory can often be 
squandered.  But vectorizing calculations still pays off, sometimes 
handsomely: there is an example in that book of going from several hours 
to one second (and it's a real example).

> >From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
> >To: R A F <raf1729 at hotmail.com>
> >CC: r-help at stat.math.ethz.ch
> >Subject: Re: [R] Loops and memory
> >Date: Tue, 6 May 2003 20:03:08 +0100 (BST)
> 
> >That was written in 1996, when rich people had 64Mb of RAM and teaching
> >labs often had 4 or 8Mb (and R would not run much of the code in the book
> >and crashed quite often).  Take a look at `S Programming' for a less
> >ancient view.

-- 
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-help mailing list