title: How to get original row index after extracting and working with a subset of a data frame
body: <p>I have a data frame </p>
  
  <pre><code>df&lt;-structure(list(time = structure(c(1080868500, 1080868800, 1080869100, 
  1080869400, 1080869700, 1080870000, 1080870300, 1080870600, 1080870900, 
  1080871200, 1080871500, 1080871800, 1080872100, 1080872400, 1080872700, 
  1080873000, 1080873300, 1080873600, 1080873900, 1080874200, 1080874500, 
  1080874800, 1080875100, 1080875400, 1080875700, 1080876000, 1080876300, 
  1080876600, 1080876900, 1080877200, 1080877500, 1080877800, 1080878100, 
  1080878400, 1080878700, 1080879000, 1080879300, 1080879600, 1080879900, 
  1080880200, 1080880500, 1080880800, 1080881100, 1080881400, 1080881700, 
  1080882000, 1080882300, 1080882600, 1080882900, 1080883200), class = c("POSIXct", 
  "POSIXt"), tzone = "UTC"), precip = c(1.76, 1.76, 1.21, 0.78, 
  0.59, 0.59, 0.62, 0.62, 0.81, 0.81, 1.14, 0.82, 0.87, 1.03, 0.98, 
  0.77, 0.77, 0.45, 0.55, 0.82, 0.8, 0.58, 0.7, 0.7, 1.03, 1.25, 
  1.32, 1.68, 2.6, 1.49, 3.85, 3.91, 2.94, 3.63, 4.12, 1.85, 2.02, 
  3.46, 3.45, 2.53, 2.88, 3, 2.42, 1.56, 1.44, 1.43, 1.33, 1.27, 
  1.35, 1.4)), .Names = c("time", "precip"), row.names = 236752:236801, class = "data.frame")
  </code></pre>
  
  <p>I want to find the maximum value that exists between rows 10 and 20. But I want to find the original index of that maxim value.</p>
  
  <pre><code>which.max(df[10:20,]$precip)
  </code></pre>
  
  <p>gives me the index of 2. I know I can add it to row index 10. But is there a proper way to do it?</p>