Hi

I think a for loop would be more what you want.

Something along the lines of:


V<-list(a=c(1,2,3), b=c(2,3,4)) # list of 2 vectors

for ( i in 1:2 ) {          # 2 vectors (replace with 85 ...)
    print(range (V[i], na.rm = TRUE))
}


Regards

JS
 
---

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Birgit Lemcke
Sent: 28 June 2007 10:48
To: R Hilfe
Subject: [R] Repeat if

Hello,
(Power Book G4, Mac OS X, R 2.5.0)

I would like to repeat the function range for 85 Vectors (V1-V85).
I tried with this code:

i<-0
 > repeat {
+ i<-i+1
+ if (i<85) next
+ range (Vi, na.rm = TRUE)
+ if (i==85) break
+ }

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to