title: Concatenate column names in data.table based on conditions
body: <p>This is what my data.table looks like. The rightmost column <code>PASTE</code> is my desired column.  </p>
  
  <pre><code>library(data.table) 
  
      dt &lt;- fread('
      A      B     C      PASTE
      TRUE  FALSE TRUE    A,C   
      TRUE  TRUE  TRUE    A;B;C
      FALSE TRUE  FALSE   B
      FALSE FALSE FALSE   
      ')
  </code></pre>
  
  <p>I am trying to create the column <code>PASTE</code> by concatenating all the column names <strong>as long as the value in that row for that column is TRUE.</strong></p>
  
  <p>This is my attempt:</p>
  
  <pre><code>dt[,PASTE:= if(dt[,c(1:3),with=FALSE] == TRUE, paste(names(dt), sep= ";"),"")]
  </code></pre>