From Thomas.Petzoldt at tu-dresden.de  Mon Aug 27 16:20:59 2007
From: Thomas.Petzoldt at tu-dresden.de (Thomas Petzoldt)
Date: Mon, 27 Aug 2007 16:20:59 +0200
Subject: [Rd] silent option in nested calls to try()
In-Reply-To: <Pine.LNX.4.64.0708270815060.2819@itasca.stat.uiowa.edu>
References: <46D2C659.90208@tu-dresden.de>
	<Pine.LNX.4.64.0708270815060.2819@itasca.stat.uiowa.edu>
Message-ID: <46D2DDCB.6060008@tu-dresden.de>

Dear Luke,

thank you very much for your immediate answer. The problem I see is, 
however, that while one can rewrite ones outer code using tryCatch, one 
may not have control over the use of try in a given inner function.

Thomas



Luke Tierney wrote:
> 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
>> >
>>
>>
>>
>>
>



[Rd] silent option in nested calls to try()
Thomas Petzoldt