[R] Loop Help

Özgür Asar oasar at metu.edu.tr
Sat Jun 16 05:27:19 CEST 2012


Hi,

Do you mean printing the results of 

degree_w(net.101031)

and

apply(net.101031, 2, mean) 

in a loop?

see ?print to print the results

and 

?cat as a suporting function.

For instance see the toy example below

for (i in 1:5){
print('------------------------------------')
cat("model",i,"\n")
print(summary(lm(rnorm(10,0,1)~rnorm(10,0,2))))
}

Hope this helps
Ozgur



--
View this message in context: http://r.789695.n4.nabble.com/Loop-Help-tp4633558p4633572.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list