Re: [R] try question

From: <Richard.Cotton_at_hsl.gov.uk>
Date: Tue, 29 Jul 2008 18:07:32 +0100


> > try(log(rnorm(25)),silent=TRUE)
> [1] -0.26396185 NaN NaN -0.13078069 -2.44997193
> -2.15603971 NaN 0.94917495 0.07244544 NaN
> [11] -1.06341127 -0.42293099 -0.53769569 0.95134763 0.93403340
> NaN -0.10502078 NaN 0.30283262 NaN
> [21] -0.11696872 -3.84122332 NaN NaN -0.12808690
> Warning message:
> In log(rnorm(25)) : NaNs produced
> >
>
> I thought that putting the "silent = TRUE" would suppress the
> warnings, please. What should I do instead, please?
The 'silent' argument to try supresses errors, not warnings. You can convert warnings to errors with options(warn=2), or ignore warnings with options(warn=-1). See ?options for more details.

Regards,
Richie.

Mathematical Sciences Unit
HSL



ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 29 Jul 2008 - 17:10:18 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 Tue 29 Jul 2008 - 17:32:51 GMT.

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

list of date sections of archive