Re: [R] Recursive solution with for()

2007-12-20 Thread Christos Hatzis
It not entirely clear, but I think that you are looking for seq(t-1, 1) -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Owe Jessen > Sent: Thursday, December 20, 2007 1:29 PM > To: [EMAIL PROTECTED] > Subject: [R]

[R] Recursive solution with for()

2007-12-20 Thread Owe Jessen
Hello, i just ran into the following problem: I wanted to recursively solve equations of the type x_1[t]=x_1[t+1]+beta*x_2[t], and used a for-loop written for(j in c(1:t-1, recursive=TRUE){ ... } This didn't work, so i resolved to writing for(j in c(10,9,...,1){ which worked, but is not terri