title: R:Finding rows which meet conditions
body: <p>I've seen a few threads on this and have formulated a semi-answer, but what I require is slightly different from what I've seen. I'm looking to find the row BELOW a row which meets certain conditions. That is obviously a condition in and of itself, but I don't know how to formulate it in R. The code I have so far is:  </p>
  
  <pre><code>index = decisionMatrix[,1] == 1 &amp; decisionMatrix[,9] == 1  
  decisionMatrix[index,7] = .01  
  </code></pre>
  
  <p>which assigns the value 0.01 to column 7 of rows that meet that condition. I would like to also make column 7 of the row below the selected rows = 0.1.   </p>
  
  <p>Any help would be greatly appreciated!<br>
  Thanks<br>
  Mike</p>