title: Remove rows where all variables are NA using dplyr
body: <p>I'm having some issues with a seemingly simple task: to remove all rows where <em>all</em> variables are <code>NA</code> using dplyr. I know it can be done using base R (<a href="https://stackoverflow.com/questions/6471689/remove-rows-in-r-matrix-where-all-data-is-na">Remove rows in R matrix where all data is NA</a> and <a href="https://stackoverflow.com/questions/6437164/removing-empty-rows-of-a-data-file-in-r">Removing empty rows of a data file in R</a>), but I'm curious to know if there is a simple way of doing it using dplyr.</p>
  
  <p>Example:</p>
  
  <pre><code>library(tidyverse)
  dat &lt;- tibble(a = c(1, 2, NA), b = c(1, NA, NA), c = c(2, NA, NA))
  filter(dat, !is.na(a) | !is.na(b) | !is.na(c))
  </code></pre>
  
  <p>The <code>filter</code> call above does what I want but it's infeasible in the situation I'm facing (as there is a large number of variables). I guess one could do it by using <code>filter_</code> and first creating a string with the (long) logical statement, but it seems like there should be a simpler way.</p>
  
  <p>Another way is to use <code>rowwise()</code> and <code>do()</code>:</p>
  
  <pre><code>na &lt;- dat %&gt;% 
    rowwise() %&gt;% 
    do(tibble(na = !all(is.na(.)))) %&gt;% 
    .$na
  filter(dat, na)
  </code></pre>
  
  <p>but that does not look too nice, although it gets the job done. Other ideas?</p>