Displaying 2 results from an estimated 2 matches for "nan_produced".
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
...cture(
list(message = message, call = call, id = id),
class = c("simpleMessage", "message", "condition")
)
}
I envisage IDs being strings, for example, the "NaN produced" warning
when you ask call, e.g., sqrt(-1) could have an ID of
"base:sqrt:nan_produced".
suppressMessage and suppressWarnings gain an ids arg, defaulting to
NULL, which preserves existing behaviour. If it takes a character
vector, messages with the IDs provided get muffled. Something like:
suppressMessages <- function (expr, ids = NULL)
{
withCallingHandlers(
expr,...
2015 Sep 10
0
Using IDs to suppress specific messages and warnings
...e, call = call, id = id),
> class = c("simpleMessage", "message", "condition")
> )
> }
>
> I envisage IDs being strings, for example, the "NaN produced" warning
> when you ask call, e.g., sqrt(-1) could have an ID of
> "base:sqrt:nan_produced".
>
> suppressMessage and suppressWarnings gain an ids arg, defaulting to
> NULL, which preserves existing behaviour. If it takes a character
> vector, messages with the IDs provided get muffled. Something like:
>
> suppressMessages <- function (expr, ids = NULL)
> {...