rsalad
rsalad copied to clipboard
add a quiet() function
Some functions annoyingly ALWAYS write out some text, for example mixtools::normalmixEM. capture.output can suppress it, but the syntax is different on different OS, so it's hard to use in a package. It's be nice to write something generic. Maybe even make sure that warnings and messages are suppressed as well
Something like this
function(expr) {
expr <- suppressWarnings(suppressMessages(exp))
if (Sys.info()['sysname'] == "Windows") {
capture.output(expr, file = "NUL")
} else {
capture.output(expr, file = "/dev/null")
}
}
from ddpcr