title: Why does indexing with a single character index work on a data frame but not a matrix?
body: <p>In data frames, <code>[</code>-indexing can be performed using a single character. E.g. <code>mtcars[&quot;mpg&quot;]</code>.</p>
  <p>On the other hand, trying the same on a matrix, results in <code>NA</code>, e.g.</p>
  <pre><code>m = cbind(A = 1:5, B = 1:5)
  m[&quot;A&quot;]
  # NA
  </code></pre>
  <p>...implying that this is somehow an invalid way to subset a matrix.</p>
  <p>Is this normal R behavior? If so, where is it documented?</p>