title: Efficient way to concatenate the names of the 7 highest columns per row?
body: <p>This code will take the names of the 7 highest columns in the first row and then paste them together in a new variable. I want to do this for every row in a dataset that's 1M rows long and I cannot do a loop in a reasonable amount of time. What's the most efficient way to do this in R? </p>
  
  <p>Thanks    </p>
  
  <pre><code>data(mtcars)
  mtcars$names = ""
  mtcars[1,]$names = paste(names(sort(mtcars[1,1:11]))[5:11],collapse = " ")
  </code></pre>