[R] loop

Davide Crapis cradav at hotmail.it
Sat Sep 6 15:29:35 CEST 2008


I have to calculate a formula that gives me a ten components vector. I want
to see how the components behave at varying the variable i.
But when i run the following function:
> bbayes<-c()
> for(i in 1:100) {
+ xx<-t(X1_10)%*%X1_10
+ xxmeno1<-solve(xx)
+ V<-xxmeno1*i
+ Vmeno1<-solve(V)
+ tx<-t(X1_10)
+ prpar<-solve(Vmeno1+xx)
+ snpar<-tx%*%y
+ bbayes<-prpar%*%snpar
+ }

it oly gives me the vector calculated with the last value of the sequence,
in this case 100.
Could you please suggest how to print all the 100 vectors calculated for i
in 1:100.

Thank you in advance.

Davide Crapis
-- 
View this message in context: http://www.nabble.com/loop-tp19346683p19346683.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list