title: Return the column name as as a value in a column
body: <p>I'm working on a classifier and I'm pretty much stuck on the last step. An image of my output is below. Each row corresponds with one observation and the values determine what target class it will be, the highest value wins. The following <a href="https://i.stack.imgur.com/0giXw.png" rel="nofollow noreferrer">Table</a> is an example of my intermediate output.
  I'm currently writing the function with the tidyverse dialect and so far I've tried the following and received an empty column:</p>
  <pre class="lang-r prettyprint-override"><code>result &lt;- result %&gt;%
    rowwise() %&gt;%
    transmute(class = colnames(max(c_across())))
  return(result)
  </code></pre>
  <p>My intention with <code>colnames(max(c_across)))</code> is to find the column with the highest value and assign it's name to class.</p>