do you mean this?
for (i in 1:10) {
o <- myfunction(x, y)
#do smth with x and output and put it back into x
x <- rbind(x, o) #rbind is hypothetical, put your update here
}
on next iteration x will be changed/"updated with o" of course.
i'm probably misreading your question..
On 02/28/2008 12:32 AM, Alex Johnson wrote:
hey, i was wondering if anyone could help me with one
part of the for
loop function
so basically how I understand it is that for works with
for (specify number of iterations) { specify function that you want it
to do that many times}
okay, so my function is in terms of (x,y) and I want to 'update' the
values of x and y before the loop runs again
In other words, my function outputs a vector, and i want to update x
with the new x component of the output before the loop runs again...
I can't figure out how to get this to work, does anyone understand my
question? thanks a lot!
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l