Closed moodymudskipper closed 5 years ago
a tag based on :
suppress_warnings <- function(.expr, .f, ...) { eval.parent(substitute( withCallingHandlers( .expr, warning = function(w) { cm <- conditionMessage(w) cond <- if(is.character(.f)) grepl(.f, cm) else rlang::as_function(.f)(cm,...) if (cond) { invokeRestart("muffleWarning") } }) )) }
https://stackoverflow.com/questions/16517795/selective-suppresswarnings-that-filters-by-regular-expression/55182432#55182432
More sophisticated than the strictly tag, and named more in line with other tags
strictly
to work directly as given here, we need to sort out the issue about ... in tag
...
a nice example could be a select call using one_of as it has awkward warnings when column doesn't exist
one_of
done
a tag based on :
https://stackoverflow.com/questions/16517795/selective-suppresswarnings-that-filters-by-regular-expression/55182432#55182432
More sophisticated than the
strictly
tag, and named more in line with other tags