I have a package in R (ROCR) that I need to load in my R environment. Upon loading the package, a set of messages are printed. This is ordinarily fine, but since the output of my R script is being used for further analysis I want to completely disable all of this output. How do I do that? Furthermore, I'd prefer to do it without having to modify ROCR at all, so that future users of this script don't have to do that either.
So far:
sink()
doesn't work here - redirecting both stdout and std err to/dev/null
does nothing for me.- Unsurprisingly,
options(warnings=-1)
does nothing either, since these are not warnings, per se, being printed.
Any thoughts?
Loading required package: gplots Loading required package: gtools Loading required package: gdata
- Note that it won't let me format the message correctly. – WakerlysuppressMessages()
also suppresses noisy textual message, at least from packages that conform, and protects you against other packages adding new dependencies which you'd need to reflect manually. – Tigre