suppressing_warnings: suppressing_warnings tag to Selectively suppress warnings

Description Usage Arguments Examples

Description

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

Usage

1
suppressing_warnings(.regex = "*")

Arguments

.regex

a string, a function, or a formula

Examples

 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)

moodymudskipper/tags documentation built on June 25, 2019, 10:54 a.m.