title: Converting data frame column from character to numeric
body: <p>I have a data frame that I construct as such:</p>
  
  <pre><code>&gt; yyz &lt;- data.frame(a = c("1","2","n/a"), b = c(1,2,"n/a"))
  
  &gt; apply(yyz, 2, class)
        a           b 
  "character" "character"
  </code></pre>
  
  <p>I am attempting to convert the last column to numeric while still maintaining the first column as a character.  I tried this:</p>
  
  <pre><code>&gt; yyz$b &lt;- as.numeric(as.character(yyz$b))
  &gt; yyz
    a  b
    1  1
    2  2
    n/a NA
  </code></pre>
  
  <p>But when I run the apply class it is showing me that they are both character classes.</p>
  
  <pre><code>&gt; apply(yyz, 2, class)
        a           b 
  "character" "character"
  </code></pre>
  
  <p>Am I setting up the data frame wrong? Or is it the way R is interpreting the data frame?</p>