title: Find second largest number for a group in dplyr
body: <p>I don't know why the codes did not work </p>
  
  <pre><code>  dd = function(x){
    t = which.max(x[,'Sepal.Length'])
    data = x[-t,]
    m= max(data[,'Sepal.Length'])
    return(m)
  }
  
  iris %&gt;% group_by (Species) %&gt;% do(dd(.))
  </code></pre>