quiet: Suppress function messages and Concatenate and Print (cat)

View source: R/Auxiliar_functions.R

quietR Documentation

Suppress function messages and Concatenate and Print (cat)

Description

Suppress function messages and Concatenate and Print (cat)

Usage

quiet(..., messages = FALSE, cat = FALSE)

Arguments

...

the functional expression to be evaluated

messages

logical; suppress all messages?

cat

logical; suppress all concatenate and print calls from cat?

References

RDRR <https://rdrr.io/cran/SimDesign/src/R/util.R> (line)

Examples

myfun <- function(x){
   message('This function is rather chatty')
   cat("It even prints in different output forms!\n")
   message('And even at different....')
   cat("...times!\n")
   x
}

out <- myfun(1)
out

# tell the function to shhhh
out <- quiet(myfun(1))
out


pedroalencar1/DroughtSDF documentation built on May 8, 2023, 6:58 p.m.