title: suppressMessages with a return instead of a print in R?
body: <p>I have a package that has a bunch of functions that generate ggplot2 objects. Recently, ggplot2 added an update that gives a message that says:</p>
  
  <pre><code>`geom_smooth()` using method = 'loess' and formula 'y ~ x'
  </code></pre>
  
  <p>I know why ggplot2 is saying that, but I don't need to hear it <em>every</em> time I run a plot (and it confuses my users because they think they did something wrong). I know I can suppress the messages by wrapping a print statement in <code>suppressMessages</code> but I don't want to <code>print</code> a plot, I want to <code>return</code> it. If I <code>print</code> it, it will display the plot, even when I don't want to display it. </p>
  
  <p>Any ideas? Here's a minimum working example. </p>
  
  <pre><code>f = function(y,x,data){
      p = ggplot(data, aes_string(x,y)) + geom_point() + geom_smooth(se=F)
      #suppressMessages(return(p))    ### doesn't work
      suppressMessages(print(p))      ### works, but I don't want to PRINT it
  }
  data(iris)
  head(iris)
  f("Sepal.Length", "Sepal.Width", iris)
  </code></pre>