Re: [R] double for cycle

2012-07-19 Thread cesare orsini
thank you Mr. Carlson you're right, the matrix that I used as an example does not make sense. When I built the array I was not thinking of the formula s[n]=1+s[n]+rnorm(1,mean=0,sd=1), I just wanted to give an example of the structure of the matrix that I needed. Anyway I think you have solved my

Re: [R] double for cycle

2012-07-18 Thread David L Carlson
essor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of cesare orsini > Sent: Wednesday, July 18, 2012 12:39 PM > To: r-help@r-project.org > Subje

[R] double for cycle

2012-07-18 Thread cesare orsini
Hi nice people, i am trying to made a double "for" cycle, i wish that for cycle on k activates t times the for cycle on s the first cycle is this: s<-rep(1,10) s [1] 1 1 1 1 1 1 1 1 1 1 > for (n in 2:10) { + s[n]=1+s[n]+rnorm(1,mean=0,sd=1) + } > s [1] 1 4.75 4.86 4.05 4.09 4.56 4.63 4.65 4