0

I was doing computation or C# and R.net. I would like to do the computations such that it won't output warnings or results to screen but saves them to the variables. I found that the C# won't output the result to the screen if I set engine.AutoPrint = false;I there something similar to warnings as the script outputs them automatically? Or is there some r-code such that

if f(data,param1) does not output a warning 
    output f(data,param1) 
else 
    output f(data,param2)

I tried options(warn=-1) but it did not solve my problem.

Jaakko Seppälä
  • 744
  • 2
  • 7
  • 21
  • this might help some: https://stackoverflow.com/questions/3903157/how-can-i-check-whether-a-function-call-results-in-a-warning – timfaber May 29 '17 at 10:00
  • It helps although it seems a bit weird to write several nested tryCatches in complex cases. – Jaakko Seppälä May 29 '17 at 19:58
  • Hm, I found an alternative function which looks pretty neat https://stackoverflow.com/questions/3903157/how-can-i-check-whether-a-function-call-results-in-a-warning/4947528#4947528. Using `withWarnings() `you can check whether the warning message is empty or not and handle accordingly – timfaber May 30 '17 at 07:37

0 Answers0