title: R * not meaningful for factors ERROR
body: <p>I have the following data.frame and I want to perform some calculations on the 2nd column.   </p>
  
  <pre><code>&gt; test  
    code age
  1  101  15
  2  102  25
  3  103  16
  4  104  u1
  5  105  u1
  6  106  u2
  7  107  27
  8  108  27
  </code></pre>
  
  <p>As you can see, the 2nd column does not include only numbers. I omitted these cases:  </p>
  
  <pre><code>&gt; new&lt;-subset(test,code&lt;104 | code&gt;106)
  &gt; new
    code age
  1  101  15
  2  102  25
  3  103  16
  7  107  27
  8  108  27
  </code></pre>
  
  <p>But when I try to do a calculation in a new column this is what I get:  </p>
  
  <pre><code>&gt; new["MY_NEW_COLUMN"] &lt;- NA
  &gt; new
    code age MY_NEW_COLUMN
  1  101  15            NA
  2  102  25            NA
  3  103  16            NA
  7  107  27            NA
  8  108  27            NA
  &gt; new$MY_NEW_COLUMN &lt;-new[,2] * 5
  Warning message:
  In Ops.factor(new[, 2], 5) : * not meaningful for factors   
  </code></pre>
  
  <hr>
  
  <p>Why does that happen? Any suggestions?  </p>