title: get Row Number for R data frame
body: <p>A question about data frames in R.  I want to extract a row from a data frame, along with its position(row number) in the original data frame. The idea is to create a new data frame that includes the row information extracted from the previous data frame, as well as the row position from the previous data frame.  </p>
  
  <pre><code>patchLocalNo &lt;- patchList[which(patchListTop5$sensitivity == patchLocalSpec),]
  </code></pre>
  
  <p>what I want to do is take the row numbers from patchList that satisfy the which condition, and add them to a column in patchLocalNo.  </p>
  
  <p>Thank you in advance, I have searched online and asked co-workers and all I can come up with is a work-around pre-processing the data in perl.</p>