Useful if you want to suppress cat, print, message and warning. You can choose what to mute. Default all four methods are muted.

quiet(x, print_cat = TRUE, message = TRUE, warning = TRUE)

Arguments

x

function or expression or value assignment expression

print_cat

bool, mute print and cat?

message

bool, mute messages?

warning

bool, mute warnings?

Value

If your original functions has a return, it will return in invisible(x)

Examples

quiet(warning(123))
quiet(message(123))
quiet(print(123))
quiet(cat(123))
quiet(warning(123), warning = FALSE)
#> Warning: 123
quiet(message(123), message = FALSE)
#> 123
quiet(print(123), print_cat = FALSE)
#> [1] 123
quiet(cat(123), print_cat = FALSE)
#> 123