Re: [R] menu() and commands assigned to choices ->break out a repeat loop so that the next code lines to be read

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Mon 21 Mar 2005 - 21:50:29 EST

Guillaume STORCHI wrote:

> first:I'd like to have the choice between breaking out a repeat loop or
> continue it
 >
> then: i'd would like my code after the end of my repeat loop not to be read
> unless I type 2 (to continue executing the content of my repeat loop) THAT'S
> THE
> PROBLEM
>
> Is there any way to go straight out of the loop (like a "goto" associated to a
> "label") or a pause like command to prevent R from reading the entire script??
>
> I actually have this kind of code
>
> reapeat{
> ...
> ...
> ...
> switch(menu(c("continue to select points","modelling"),next,break))

With the parantheses correct you get

   switch(menu(c("continue to select points","modelling")), next, break)

which seems to work ...

Uwe Ligges

> }
> ...
> ...
>
> Thanks a lot
>
> Guillaume STORCHI
>
> ______________________________________________
> 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



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 Received on Mon Mar 21 21:55:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:51 EST