[Rd] restart

Mark.Bravington@csiro.au Mark.Bravington@csiro.au
Wed, 20 Nov 2002 14:53:11 +1100


Thanks Luke!-- a succinct and unimproveable solution.

cheers
Mark

Mark Bravington
CSIRO (CMIS)
PO Box 1538
Castray Esplanade
Hobart
TAS 7001

phone (61) 3 6232 5118
fax (61) 3 6232 5012
Mark.Bravington@csiro.au 

#-----Original Message-----
#From: Luke Tierney [mailto:luke@stat.uiowa.edu]
#Sent: Wednesday, 20 November 2002 2:40 PM
#To: Mark.Bravington@csiro.au
#Cc: r-devel@stat.math.ethz.ch
#Subject: Re: [Rd] restart
#
#
#On Wed, 20 Nov 2002 Mark.Bravington@csiro.au wrote:
#
#> Dear group
#> 
#> I use "restart" in part of my code, in a way that's not 
#easily changed to
#> "try". 

<< snipped >>

#> 
#> The problem with changing 
#> 
#>   restart( TRUE)
#>   j <- eval( i, envir=envir)
#> 
#> into
#> 
#>   j <- try( eval( i, envir=envir))
#>   if( inherits( j, 'try-error')) <<...>>
#> 
#> is that the statement being debugged may itself be a call to 
#"try" which
#> happens to fail. 

<< snipped >>

#> 
#
#One way to handle this is to wrap the result, something like
#
#   j <- try( list(value = eval( i, envir=envir)))
#   if( inherits( j, 'try-error')) <<...>>
#   ...
#   return(j$value)
#
#luke
#
#-- 
#Luke Tierney
#University of Iowa                  Phone:             319-335-3386
#Department of Statistics and        Fax:               319-335-3017
#   Actuarial Science
#241 Schaeffer Hall                  email:      luke@stat.uiowa.edu
#Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
#