[R] simplify loop

From: Omar Lakkis <uofiowa_at_gmail.com>
Date: Thu 12 May 2005 - 03:05:58 EST


Is there a way to implement this faster than doing it in a loop.

        for (i in length(settle)-1:1) {
                settle[i] = settle[i+1]/(1 + settle.pct[i+1])
        }

I want to guarantee that i+1 is calculated before i



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 12 03:12:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:41 EST