Skip to content
Back to formatted view

Raw Message

Message-ID: <20010126221732.6330.qmail@web11504.mail.yahoo.com>
Date: 2001-01-26T22:17:32Z
From: Yu-Ling Wu
Subject: a loop to chang data matrix name

Hi,

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

Thanks,
Yu-Ling Wu

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._