title: Difference between Distinct vs Unique
body: <p>What are the differences between <code>distinct</code> and <code>unique</code> in R using dplyr in consideration to:</p>
  
  <ul>
  <li>Speed</li>
  <li>Capabilities (valid inputs, parameters, etc) &amp; Uses</li>
  <li>Output</li>
  </ul>
  
  <p>For example:</p>
  
  <pre><code>library(dplyr)
  data(iris)
  
  # creating data with duplicates
  iris_dup &lt;- bind_rows(iris, iris)
  
  d &lt;- distinct(iris_dup)
  u &lt;- unique(iris_dup)
  
  all(d==u) # returns True
  </code></pre>
  
  <p>In this example <code>distinct</code> and <code>unique</code> perform the same function. Are there examples of times you should use one but not the other? Are there any tricks or common uses of one? </p>