Hello John,

I tried this code. But I got only the ranges of V1 and V2 what is  
easily understandable.
Do I have to write in all 85 vectors in the first line?

V<-list(a=c(V1), b=c(V2))

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


sapply(1:85, function(i) eval(parse(text=paste("range(V", i, ",  
na.rm=T)", sep=""))))

But thanks anyway.

Greetings

Birgit


Am 28.06.2007 um 12:23 schrieb john seers ((IFR)):

>
> 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: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] 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
> + }

Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
birgit.lemcke@systbot.uzh.ch






	[[alternative HTML version deleted]]

