title: Why does ggplot not allow suppressing of messages generated by its geoms?
body: <p>The <code>geom_density_ridges</code> geom from the <code>ggridges</code> package created ridgelines, and if a bandwidth is not specified, it attempts to find a sensible value. It then uses the <code>base</code> R <code>message</code> function to report that value (see <a href="https://twitter.com/ClausWilke/status/921363157553172480" rel="noreferrer">https://twitter.com/ClausWilke/status/921363157553172480</a>).</p>
  
  <p>The <code>base</code> R function <code>suppressMessages</code> function is designed to suppress such messages. For example, this code outputs a message:</p>
  
  <pre><code>message('This is a message');
  </code></pre>
  
  <p>And this code outputs nothing:</p>
  
  <pre><code>suppressMessages(message('This is a message'));
  </code></pre>
  
  <p>However, for some reason, the suppressing of messages seems, um, suppressed when this geom is added to a ggplot. The following code <em>does</em> still produce a message:</p>
  
  <pre><code>require('ggplot2');
  require('ggridges');
  suppressMessages(ggplot(Orange, aes(x=age,y=Tree)) + geom_density_ridges());
  </code></pre>
  
  <p>(Specifically, "<code>Picking joint bandwidth of 319</code>".)</p>
  
  <p>Why is this? Does <code>ggplot</code> do something to ensure that messages come through regardless of the users' specification? Or is this actually sensible behavior that I just happen to not know about?</p>
  
  <p>When generating RMarkdown reports, the chunk option <code>message</code> can be set to <code>message=FALSE</code>, which suppresses all messages at the rendering level. And since that's my use case, my problem is solved.</p>
  
  <p>And as Claus Wilke, the author of the <code>ggridges</code> package, suggested, you can always set the <code>bandwidth</code> of manually to avoid the message (<a href="https://twitter.com/ClausWilke/status/921361195231215616" rel="noreferrer">https://twitter.com/ClausWilke/status/921361195231215616</a>).</p>
  
  <p>But <em>why</em> doesn't <code>suppressMessages</code> suppress the message in the first place?</p>
  
  <p>Is this expected behavior that I just happen to not know about?</p>