title: How do I convert certain columns of a data frame to become factors?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5798206/identifying-or-coding-unique-factors-using-r">identifying or coding unique factors using R</a>  </p>
  </blockquote>
  
  
  
  <p>I'm having some trouble with R. </p>
  
  <p>I have a data set similar to the following, but much longer.</p>
  
  <pre><code>A B Pulse
  1 2 23
  2 2 24
  2 2 12
  2 3 25
  1 1 65
  1 3 45
  </code></pre>
  
  <p>Basically, the first 2 columns are coded. <code>A</code> has 1, 2 which represent 2 different weights.
  <code>B</code> has 1, 2, 3 which represent 3 different times. </p>
  
  <p>As they are coded numerical values, R will treat them as numerical variables.
  I need to use the factor function to convert these variables into factors. </p>
  
  <p>Help?</p>