Skip to content
Prev 23735 / 63424 Next

Speed of for loops

Actually, better yet:

gen.iter = function(y=NA) {
  function(x) {
    y <<- if(is.na(y)) x else x+y
  }
}
sapply(x,gen.iter())
On 1/30/07, Byron Ellis <byron.ellis at gmail.com> wrote: