title: How to specify columns to exclude when retaining all distinct rows?
body: <p>How do you retain all distinct rows in a data frame excluding certain columns by specifying only the columns you want to exclude. In the example below</p>
  
  <pre><code>library(dplyr)
  dat &lt;- data_frame(
      x = c("a", "a", "b"),
      y = c("c", "c", "d"),
      z = c("e", "f", "f")
  )
  </code></pre>
  
  <p>I'd like to return a data frame with all distinct rows among variables <code>x</code> and <code>y</code> by only specifying that I'd like to exclude column <code>z</code>. The data frame returned should look like the data frame returned from here</p>
  
  <pre><code>dat %&gt;% distinct(x, y)
  </code></pre>
  
  <p>You would think you can do the following, but it results in an error</p>
  
  <pre><code>dat %&gt;% distinct(-z)
  </code></pre>
  
  <p>I prefer a tidyverse solution</p>