Displaying 1 result from an estimated 1 matches for "suppresswarnig".
Did you mean:
suppresswarnigs
2008 Dec 07
4
Finding the first value without warning in a loop
Dear R useRs,
with the following piece of code i try to find the first value which can
be calculated without warnings
`test` <- function(a)
{
repeat
{
## hide warnings
suppressWarnings(log(a))
if (exists("last.warning", envir = .GlobalEnv))
{
a <- a + 0.1
## clear existing warnings
rm("last.warning", envir = .GlobalEnv)
}