title: R ROWMAX Based On Criteria
body: <pre><code>data=data.frame("id"=c(1,2,3,4),
  "score1"=c(1,1,2,1),
  "score2"=c(1,2,3,3),
  "score3"=c(2,3,1,1),
  "score4"=c(3,4,4,2),
  "score1WANT"=c(1,1,2,1),
  "score2WANT"=c(1,2,3,3),
  "score3WANT"=c(2,3,3,3),
  "score4WANT"=c(3,4,4,3))
  </code></pre>
  
  <p>Here there are four possible scoring options: 1,2,3,4.</p>
  
  <p>If any 'score' equals to 3 then all subsequent scores equals to 3 UNLESS there is a 4. So as example: 1 3 2 2 should be change to 1 3 3 3 . 3 2 3 4 should be change to 3 3 3 4.</p>
  
  <p>I try to do this with ROWMAX but the problem is that there is a 4 and so then it sets values to 4 if there is a 4.</p>