[R] Difficulties with for() {while(){}}

TEMPL Matthias Matthias.Templ at statistik.gv.at
Wed Nov 16 14:32:09 CET 2005


Is this possible:

function(){
  initialize <- function( ){ initialize }
  for(i in test){
   ...
   if( j <= test2 ) {i <- 1; initialize()} 
   ...
  }

Best,
Matthias

> Hi,
> 
> I have the follow function:
> 
> function() {
> 
>   ## Init of function
>   ...
> 
>   for(i in test) {
>     ...
> 
>     while(j <= test2) {
>     ...
> 
>     }
>   }
> }
> 
> The problem is that sometimes, naturally, the while is not 
> possible to be 
> resolved, and so the program abort.
> 
> In this case I need that program return to the init of 
> function and run again.
> 
> How I can make this? Abort the while, abort the for and run 
> the function 
> again?
> 
> Thanks
> Ronaldo
> -- 
> 	Os homens ficam terrivelmente chatos quando sao bons 
> 	maridos, e abominavelmente convencidos quando nao 
> 	sao.
> 		-- Oscar Wilde 
> --
> |>   // | \\   [***********************************]
> |   ( õ   õ )  [Ronaldo Reis Júnior                ]
> |>      V      [UFV/DBA-Entomologia                ]
> |    /     \   [36570-000 Viçosa - MG              ]
> |>  /(.''`.)\  [Fone: 31-3899-4007                 ]
> |  /(: :'  :)\ [chrysopa at insecta.ufv.br            ]
> |>/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
> |    ( `-  )   [***********************************]
> |>>  _/   \_Powered by GNU/Debian Woody/Sarge
> 
> ______________________________________________
> R-help at 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
>




More information about the R-help mailing list