quiet | R Documentation |
Silence messages from noisy functions. Optionally silence warning messages too.
quiet(expr, suppressWarnings = FALSE)
expr |
the expression that you desire to silence (i.e., the function along with its arguments) |
suppressWarnings |
a logical (TRUE or FALSE), noting whether you wish
to suppress warning messages. The default is |
whatever should be returned by the expression that is being silenced
# Suppresses only messages
result <- quiet({
message("This message is silenced")
warning("This warning is shown")
42 # Return a value
})
# Suppresses both messages and warnings
result <- quiet({
message("This message is silenced")
warning("This warning is silenced too")
42 # Return a value
}, suppressWarnings = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.