[R] a loop to chang data matrix name

Yu-Ling Wu yuling5 at yahoo.com
Fri Jan 26 23:17:32 CET 2001


I have 50 data matrix x1 ~ x5. I want to write a loop
to check the number of 
rows for each data matrix. How to make the data matrix
name (numerical part)
increase by 1 each time it loops?

That is, 
loop1:  nrow(x1)
loop2: nrow(x2)
loop50: nrow(x50)

for (i in 1:50) {
   if nrow( xi ) > 20    <=== how to make this work?
      do someting ......

Yu-Ling Wu

Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
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