title: extracting row labels (?) from a data.frame
body: <p>Starting with a data.frame...</p>
  
  <pre><code>df = data.frame(k=c(1,5,4,7,6), v=c(3,1,4,1,5))
  &gt; df
    k v
  1 1 3
  2 5 1
  3 4 4
  4 7 1
  5 6 5
  </code></pre>
  
  <p>I might run some number of arbitrary manipulations...</p>
  
  <pre><code>&gt; foo1 = df[df$k&gt;3,]
  &gt; foo2 = head(foo1[order(foo1$v),], 2)
  &gt; foo2
    k v
  2 5 1
  4 7 1
  </code></pre>
  
  <p>At this point <code>foo2</code> has somehow retained the original row numbers from<code>df</code> (in this case 2 and 4).</p>
  
  <p>How do I extract these?</p>
  
  <pre><code>&gt; insert_magic_function_here(foo2)
  [1] 2 4
  </code></pre>