title: drop = TRUE doesn't drop factor levels in data.frame while in vector it does
body: <p>There is an interesting option <code>drop = TRUE</code> in data.frame filtering, see excerpt from <code>help('[.data.frame')</code>:</p>
  
  <blockquote>
    <h3>Usage</h3>
    
    <p>S3 method for class 'data.frame'</p>
  
  <pre><code>x[i, j, drop = ]
  </code></pre>
  </blockquote>
  
  <p>But when I try it on data.frame, it doesn't work!</p>
  
  <pre><code>&gt; df = data.frame(a = c("europe", "asia", "oceania"), b = c(1, 2, 3))
  &gt;
  &gt; df[1:2,, drop = TRUE]$a
  [1] europe asia  
  Levels: asia europe oceania     &lt;--- oceania shouldn't be here!!
  &gt;
  </code></pre>
  
  <p>I know there are other ways like</p>
  
  <pre><code>df2 &lt;- droplevels(df[1:2,])
  </code></pre>
  
  <p><strong>but the documentation promised much more elegant way to do this, so why it doesn't work?</strong> Is it a bug? Because I don't understand how this could be a feature...</p>
  
  <p><strong>EDIT</strong>: I was confused by <code>drop = TRUE</code> dropping factor levels for vectors, as <a href="http://quantitative-ecology.blogspot.cz/2008/02/drop-unused-factor-levels.html" rel="noreferrer">you can see here</a>. It is not very intuitive that <code>[i, drop = TRUE]</code> drops factor levels and <code>[i, j, drop = TRUE]</code> does not!!</p>