Selectively muffle warnings based on output

hushWarning(expr, regexp)

Arguments

expr
an expression
regexp
a regexp to be matched (with str_detect)

Value

the result of expr

Examples

hushWarning(warning('Beware the rabbit'), 'rabbit') hushWarning(warning('Beware the rabbit'), 'hedgehog')
#> Warning: Beware the rabbit