title: Find column index where row value is greater than zero in R
body: <p>I have data set as follows:</p>
  
  <pre><code>    A   B   C
  R1  1   0   1
  R2  0   1   0
  R3  0   0   0
  </code></pre>
  
  <p>I want to add another column in data set named index such that it gives column names for each row where the column value is greater than zero. The result I want is as follows:</p>
  
  <pre><code>    A   B   C   Index
  R1  1   0   1   A,C
  R2  0   1   0   B
  R3  0   0   0   NA
  </code></pre>