shush() is a wrapper around suppressMessages() and suppressWarnings() that allows you to suppress messages and warnings in a single function call. It was designed to be used with pipes.

shush(x, quiet = TRUE)

Arguments

x

Any expression, usually a function call.

quiet

(optional) A logical flag value indicating whether to suppress messages and warnings. This is can be used for condition messages and warnings inside functions (default: TRUE).

Value

The same object as x with messages and warnings suppressed.

Examples

message("test") |> shush()
message("test") |> shush(quiet = FALSE)
#> test
#> test # Expected

warning("test") |> shush()
warning("test") |> shush(quiet = FALSE)
#> Warning: test
#> Warning: test # Expected