[R] R-SCRIPT Label Calling Method

Oliver Ruebenacker curoli at gmail.com
Tue Jun 12 18:23:52 CEST 2012


     Hello,

On Tue, Jun 12, 2012 at 10:25 AM, Rantony <antony.akkara at ge.com> wrote:
> Hi,
>
> here i have some code...
>
>
> a <-1
> b <- b+1
> c <- b+a/20
> if c >5
> { d<- 1 }
> else {  d<- 0  }
>
> i want to repeat this code from the 2nd line [b <- b+1] without using loop.
> Actulay i want to use  "*Label *" and call *GoTo* method like in other
> coding Languages.
> For eg:- like this,
>
>                           a <-1
> *LabelBegin :*
>                           b <- b+1
>                           c <- b+a/20
>                           if c >5
>                                      { d<- 1 }
>                           else {  d<- 0  }
>                          *Go to LabelBegin*
>
> Is there any method like that in R-Script ? Could you please help me fast, i
> have an urgent requirement.

  Can you explain why you want a goto? You may be aware that opinions
in the computer science community on goto range from "never use" to
"use very sparingly".

     Take care
     Oliver

-- 
Oliver Ruebenacker
Bioinformatics Consultant (http://www.knowomics.com/wiki/Oliver_Ruebenacker)
Knowomics, The Bioinformatics Network (http://www.knowomics.com)
SBPAX: Turning Bio Knowledge into Math Models (http://www.sbpax.org)



More information about the R-help mailing list