title: S4 object inheriting from data.frame: remove warning in dplyr::filter
body: <p>I have an S4 class that inherits from data.frame:</p>
  
  <pre><code>&gt; setClass("Foo", contains="data.frame")
  &gt; x &lt;- new("Foo", data.frame(a=1:2))
  </code></pre>
  
  <p>Now <code>dplyr::filter</code> works but issues a warning:</p>
  
  <pre><code>&gt; x %&gt;% dplyr::filter(a &gt; 1)
    a
  1 2
  Warning message:
  In class(x) &lt;- c("tbl_df", "tbl", "data.frame") :
    Setting class(x) to multiple strings ("tbl_df", "tbl", ...); result
    will no longer be an S4 object
  </code></pre>
  
  <p>Is there any good way to get rid of this warning?  I can create a new
  generic of <code>filter</code>, and wrap the dplyr version in this something
  like</p>
  
  <pre><code>dplyr::filter(as.data.frame(unclass(x)), ...)
  </code></pre>
  
  <p>but isn't the point with inheritance to avoid such extra work?</p>
  
  <p>Is this warning related to dplyr not being aware of S4 objects?</p>
  
  <p>Edit: same behavior for dplyr 0.4.3 and 0.5.0</p>