[R] Question

Ambrosini Alessandro klavan at tiscalinet.it
Tue May 14 14:13:39 CEST 2002

Hello. I want to use "for".
I have a matrix called "mat" that has got 100 rows.
I want to take the line 1 and make


After this I want to take the second row and make


and so on until I arrive at row 100.

I want to make it automatic for the 100 rows and so I wrote:

for(i in 1:nrow(mat)){

but it doesn't work.
I need to obtain 100 vectors called a1,a2,a3,...,a100. 
Please help me.
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list