1

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?

2
  • 1
    engine.Evaluate("suppressWarnings(library(tseries, quietly = TRUE, warn.conflicts = TRUE))") you could also wrap it arround suppressMessages function if there are messages that you dont want
    – Onyambu
    CommentedJun 23, 2022 at 5:33
  • Change the warn.conflicts = FALSE
    – Onyambu
    CommentedJun 23, 2022 at 6:33

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.