Skip to content
Prev 17958 / 398503 Next

apply problem

On Sun, 17 Mar 2002 ggrothendieck at yifan.net wrote:

            
No.  A row of a data frame is still a data frame and therefore arbitrarily
complex.

In any case, in R apply() does write a loop.  There are lots of legacy
myths about the efficiencies of loops vs *apply(), but the reality it
depends on the exact version of your S engine (and perhaps on how much
memory you have).

Just for the record, lapply() is the way to iterate over columns of a data
frame.