[R] R question

Faheem Mitha faheem at email.unc.edu
Thu Dec 16 20:41:25 CET 1999


I have the following question, which is elementary but I am unable to
answer.
In a for(i=10) loop, I am trying to represent the 10 1-dimensional vectors 
l1, l2,... l10 by some expression that will run through these values.
ie. soppose I want to add l1 + ... + l10
I could go

x <- 0
for(i in 1:10){ x <- x+ l(i)} 

This should return x to be the sum of the 10 li's for i from 1 to 10
except of course I'm doing something more complicated. 
But l(i) of course does not serve to represent l1 etc? What should I do?

                                    Faheem Mitha,


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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