From luke at stat.uiowa.edu  Wed Oct  4 16:40:01 2006
From: luke at stat.uiowa.edu (Luke Tierney)
Date: Wed, 4 Oct 2006 09:40:01 -0500 (CDT)
Subject: [Rd] Bug in warning() for condition objects (PR#9274)
In-Reply-To: <20061004003234.1973A49FDD@slim.kubism.ku.dk>
References: <20061004003234.1973A49FDD@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.64.0610040939150.17688@nokomis.stat.uiowa.edu>

Thanks.  I think your analysis is probably correct.  Will look into
this and fix shortly.

Best,

luke

On Wed, 4 Oct 2006, dhinds at sonic.net wrote:

> Full_Name: David Hinds
> Version: 2.4.0
> OS: Windows XP
> Submission from: (NULL) (64.168.232.238)
>
>
> A (maybe naive) use of tryCatch to trap errors and report as warnings does not
> work, i.e.:
>
>  x <- tryCatch(lm(xyzzy), error=warning)
>
> In src/library/base/R/stop.R, the warning() function contains the following
> code, for handling condition objects:
>
>        withRestarts({
>            .Internal(.signalCondition(cond, message, call))
>            .Internal(.dfltStop(message, call))
>        }, muffleWarning = function() NULL)
>
> So all conditions result in calling .dfltStop().  It would seem more useful
> and/or consistent for warning() to call .dfltWarn(), or in the alternative, to
> choose between .dfltStop and .dfltWarn based on the class of the condition
> object.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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




[Rd] Bug in warning() for condition objects (PR#9274)
Luke Tierney