title: Create column in R data frame with second highest value in each row
body: <p>Sorry if I am asking a trivial question, but the fact is I have spent a few hours reading answers in this data base and could not find what I am looking for.</p>
  
  <p>I have a dataframe similar to this </p>
  
  <pre><code>df=data.frame(v1=c(24,15, 0, 7,36,10), c1=c(22,15,0,0,28,11), v2=c(0,10,0,19,0,0), c2=c(0,7,0,22,0,0), v3=c(54,22,28,55,62,38), c3=c(44,23,22,66,71,44))
  </code></pre>
  
  <p>(The original, of course, has many more rows and columns)</p>
  
  <p>I would like to create two columns with the maximum and the second highest values of all the "v" columns.</p>
  
  <p>For the maximum, this works:</p>
  
  <pre><code>df$max.v=mapply(FUN=max, df$v1, df$v2, df$v3, na.rm=TRUE)
  </code></pre>
  
  <p>But I cannot find a way to do it for the second highest value. 
  It probably needs some kind of function, but I could not find how to do it.</p>