title: Read csv file in R with currency column as numeric
body: <p>I'm trying to read into R a csv file that contains information on political contributions.  From what I understand, the columns by default are imported as factors, but I need the the amount column ('CTRIB_AMT' in the dataset) to be imported as a numeric column so I can run a variety of functions that wouldn't work for factors.  The column is formatted as a currency with a "$" as prefix.</p>
  
  <p>I used a simple read command to import the file initially:</p>
  
  <pre><code>contribs &lt;- read.csv('path/to/file')
  </code></pre>
  
  <p>And then tried to convert the CTRIB_AMT from currency to numeric:</p>
  
  <pre><code>as.numeric(as.character(sub("$","",contribs$CTRIB_AMT, fixed=TRUE)))
  </code></pre>
  
  <p>But that didn't work.  The functions I'm trying to use for the CTRIB_AMT columns are:</p>
  
  <pre><code>vals&lt;-sort(unique(dfr$CTRIB_AMT))
  sums&lt;-tapply( dfr$CTRIB_AMT, dfr$CTRIB_AMT, sum)
  counts&lt;-tapply( dfr$CTRIB_AMT, dfr$CTRIB_AMT, length)
  </code></pre>
  
  <p>See related question <a href="https://stackoverflow.com/questions/7329733/bubble-chart-in-r-with-of-occurrences-sums-of-values">here</a>.</p>
  
  <p>Any thoughts on how to import file initially so column is numeric or how to convert it after  importing?</p>