[R] any alternatives for complex for-loops?

Kinoko andzsinszan at gmail.com
Wed Nov 12 03:30:09 CET 2008


Dear list,

Is there a way to do something like the following pseudo-code -
without for loop?

complexFn <- function(a,b){
  ...
  return(c)
}

x[i] = complexFn(x[i-1], x[i-2])


I have found "filter" but would like to do something more complicated
than multiplication with x[i-1] and x[i-2].

Thanks in advance!

gabor



More information about the R-help mailing list