title: Distinct in dplyr does not work (sometimes)
body: <p>I have the following data frame which I have obtained from a count. I have used <code>dput</code> to make the data frame available and then edited the data frame so there is a duplicate of <code>A</code>. </p>
  
  <pre><code>df &lt;- structure(list(Procedure = structure(c(4L, 1L, 2L, 3L), .Label = c("A", "A", "C", "D", "-1"), 
                                           class = "factor"), n = c(10717L, 4412L, 2058L, 1480L)), 
                class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -4L), .Names = c("Procedure", "n"))
  
  print(df)
  
  # A tibble: 4 x 2
    Procedure     n
    &lt;fct&gt;     &lt;int&gt;
  1 D         10717
  2 A          4412
  3 A          2058
  4 C          1480
  </code></pre>
  
  <p>Now I would like to take distinct on Procedure and only keep the first <code>A</code>. </p>
  
  <pre><code>df %&gt;% 
    distinct(Procedure, .keep_all=TRUE)
  
  # A tibble: 4 x 2
    Procedure     n
    &lt;fct&gt;     &lt;int&gt;
  1 D         10717
  2 A          4412
  3 A          2058
  4 C          1480
  </code></pre>
  
  <p>It does not work. Strange... </p>