This is really starting to bug me...I have tried a few methods and none seem to work
I am running an install from a function which generates a lot of unnecessary messages that I would like to suppress, but all of the methods I tried to do this have not worked.
The bit of code I am trying to suppress is : install_github('ROAUth', 'duncantl'), it requires the package devtools to be loaded beforehand.
Anyway, I tried invisible, capture.output and sink, none of which work...or perhaps I am not using them correctly... either way...any ideas?
suppressMessageswill turn some messages off (those that were printed though calls tomessage), but not all.The rest of the messages are coming from a shelled out call to
R CMD INSTALLvia thesystem2function. I think it is because this is shelled out that all the usual things you tried (sink,capture.output, etc.) are not working. Note that thesystem2function comes withstderrandstdoutarguments which, if turned toFALSEwould turn off all those messages. Unfortunately,system2usesstdout = ""andstderr = ""by default and there seems to be no way to access these arguments through thedevtoolspackage.So one way I managed to run without any messages is to temporarily overwrite the
system2function in the base environment. It's not particularly elegant but it works: