Re: [R] how to clear the last error?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Fri 10 Feb 2006 - 05:04:50 EST

On 2/9/2006 11:11 AM, Adrian Dragulescu wrote:
> Hello,
>
> I would like to clear the last error that I get with geterrmessage(). Not
> even rm(list=ls()) clears it. Can I set it to NULL somehow?

Not from R, but there is a C-level way to do it in src/main/errors.c. It's marked as "temporary", but it's been there since R 1.3.x.

The declaration is

void R_SetErrmessage(char *s);

Alternatively, you could just cover up the last error with a new one by calling stop, e.g.

 > try(stop(""),TRUE)
 > geterrmessage()
[1] "Error in try(stop(\"\"), TRUE) : \n"

Duncan Murdoch



R-help@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 Received on Fri Feb 10 06:26:49 2006

This archive was generated by hypermail 2.1.8 : Sat 11 Feb 2006 - 03:07:23 EST