Description Usage Arguments Examples
suppressing_warnings
permits the user to provide a regular expression that
will be forwarded to grepl
. The warning will be suppressed in case of match.
If the user feeds a function or formula to .regex
argument it will be applied
on the text of the warning, and the warning will be suppressed if the output
is TRUE
1 | suppressing_warnings(.regex = "*")
|
.regex |
a string, a function, or a formula |
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
fun <- function(x) {
warning("ooops", call. = FALSE)
sqrt(x)
}
fun(-1)
suppressing_warnings$fun(-1)
suppressing_warnings("prod")$fun(-1)
suppressing_warnings(~startsWith(., "o"))$fun(-1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.