I have the following code that uses R.Net on Windows:
engine = REngine.GetInstance(); engine.Initialize(); engine.Evaluate("library(tseries)");
Unfortunately it outputs some messages to the console which I want to suppress.
I tried using the NullCharacterDevice
in Initialize
and the invisible
R function but unfortunately they did not suppress the output of the evaluate call.
engine = REngine.GetInstance(); engine.Initialize(null, new NullCharacterDevice()); engine.Evaluate("invisible(library(tseries))");
How can I suppress all console output of R.Net?
engine.Evaluate("suppressWarnings(library(tseries, quietly = TRUE, warn.conflicts = TRUE))")
you could also wrap it arroundsuppressMessages
function if there are messages that you dont wantwarn.conflicts = FALSE