[R] any alternatives for complex for-loops?

hadley wickham h.wickham at gmail.com
Wed Nov 12 03:44:46 CET 2008


On Tue, Nov 11, 2008 at 8:30 PM, Kinoko <andzsinszan at gmail.com> wrote:
> Dear list,
>
> Is there a way to do something like the following pseudo-code -
> without for loop?

There isn't a for loop in your code!

Hadley

>
> 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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
http://had.co.nz/



More information about the R-help mailing list