Suppress printed output
quiet.RdOutput written to stdout during the evaluation of x are suppressed.
Messages, warnings, and errors are not suppressed.
Examples
#----------------------------------------------------------------------------
# quiet() examples
#----------------------------------------------------------------------------
library(bkbase)
bad_fun <- function(x) {
cat("Unwanted output\n")
x
}
# Direct call writes to stdout and returns the value:
bad_fun(2)
#> Unwanted output
#> [1] 2
# Wrapped call suppresses stdout and returns invisibly:
quiet(bad_fun(2))
# The return value is preserved:
result <- quiet(bad_fun(2))
result
#> [1] 2