I have a long R script that throws some warnings, which I can ignore. I could use
suppressWarnings(expr)
for single statements. But how can I suppress warnings in R globally? Is there an option for this?
You could use
options(warn=-1)
But note that turning off warning messages globally might not be a good idea.
To turn warnings back on, use
options(warn=0)
(or whatever your default is for warn
, see this answer)