title: Return variable name which satisfies condition on numeric variables only
body: <p>I am trying to create a new variable in my dataframe which returns the variable name for which a condition is satisfied, however I also have a chr variable on the dataset so some sort of numeric wrapper would have to be applied.</p>
  
  <p>Dataset before:</p>
  
  <pre>          ChrV   |   V1  |   V2  |   V3       
   Obs 1 |  chr1   |  <b>0.65</b> |  0.30 |  0.40
   Obs 2 |  chr2   |  0.35 |  <b>0.75</b> |  0.42
   Obs 3 |  chr3   |  0.10 |  0.43 |  <b>0.80</b></pre>
  
  <p>My Solution:</p>
  
  <ul>
  <li><p>Save chr variable.</p>
  
  <pre><code>ChrV &lt;- ds$ChrV
  </code></pre></li>
  <li><p>Delete chr variable off the dataset (alternative to numeric wrapper)</p>
  
  <pre><code>ds$ChrV &lt;- NULL
  </code></pre></li>
  <li><p>Create new column - apply across all rows of the dataset: function - paste the column names for which the absolute value of x is greater of equal to 0.5.</p>
  
  <pre><code>ds$V4 &lt;- apply(ds, 1, function(x) paste(names(which(abs(x) &gt;= 0.5))))
  </code></pre></li>
  <li><p>Bind chr variable back to the dataset.</p>
  
  <pre><code>ds &lt;- cbind(ChrV, ds)
  </code></pre></li>
  </ul>
  
  <p>Output:</p>
  
  <pre>          ChrV   |   V1  |   V2  |   V2  |   V4       
   Obs 1 |  chr1   |  <b>0.65</b> |  0.30 |  0.40 |  <b>Var 1</b>
   Obs 2 |  chr2   |  0.35 |  <b>0.75</b> |  0.42 |  <b>Var 2</b>
   Obs 3 |  chr3   |  0.10 |  0.43 |  <b>0.80</b> |  <b>Var 3</b></pre>
  
  <p>My Problem:</p>
  
  <p>While my solution works, I need to find a more elegant solution that ignores the chr variable, (so it only considers the numeric variables and I don't need to remove the variables and bind them again later), and that is also applicable to any dataset regardless of the amount of columns and rows.</p>
  
  <blockquote>
    <p>dput(ds)</p>
  </blockquote>
  
  <pre><code>structure(list(
  ChrV = c("chr1", "chr2", "chr3"), 
  V1 = c(3, 2, 1), 
  V2 = c(1, 3, 2), 
  V3 = c(1, 2, 3)), 
  row.names = c(NA, -6L), 
  class = c("data.table", "data.frame"),
   .internal.selfref = &lt;pointer: 0x0000000002541ef0&gt;)   
  </code></pre>