2

I'm using httr package in a function. I'd like to silence the message and run the code again if the message No encoding supplied: defaulting to UTF-8. is received.

I tried

 try(getDatafunction,silent=TRUE)

But it still shows the message. Is there a way to avoid it? Thanks in advance!

Chp
  • 105
  • 7
  • 2
    Perhaps this will help: https://stackoverflow.com/questions/16194212/how-to-suppress-warnings-globally-in-an-r-script. It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. It's unclear exactly what the `getDatafunction` does. – MrFlick Feb 28 '20 at 22:03
  • Thanks a lot! suppressmessages solves the problem. – Chp Feb 29 '20 at 01:36

0 Answers0