How to find top n% of records in a row of a dataframe using R
<p>I am running the following loop: </p>

<pre><code>for(i in 1:l) {
  r = volume[i,]     
  r = as.numeric(r)    
  sr = sort(r)    
  new_df = rbind(new_df, sr)
}
</code></pre>

<p>Now after sorting each row, i want to save the top 30 percent of the records in each row in a separate data frame, and bottom 30 percent of the records in a separate data frame. The number of records might differ each time the loop is run due to existence of NA values.How can i do this?</p>