Re: [Rd] silent option in nested calls to try()

From: Luke Tierney <luke_at_stat.uiowa.edu>
Date: Mon, 27 Aug 2007 08:15:22 -0500 (CDT)

Yes. If you want finer control use tryCatch.

Best,

luke

On Mon, 27 Aug 2007, Thomas Petzoldt wrote:

> Hello,
>
> is it *really intentional* that the "silent" option of try() does only
> apply to the outer call in nested try constructs? I would assume that a
> silent try() should suppress all error messages regardless where they
> occur, even if they are already handled with other try()'s.
>
> The error message itself should be (and is in both cases) reported by
> the return value of try().
>
> Thanks in advance
>
> Thomas
>
>
> ## Old behavior (tested with R-2.4.1):
> > try(try(exp(NULL)), silent=TRUE)
> >
>
>
> ## Current behavior (R-2.6.0 unstable, build 42641, WinXP):
> > try(try(exp(NULL)), silent=TRUE)
> Error in exp(NULL) : Non-numeric argument to mathematical function
> >
>
>
>
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke_at_stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 27 Aug 2007 - 13:18:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 27 Aug 2007 - 15:09:59 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.