title: Converting data.frame from character to numeric in R to use in Time Series function
body: <p>I am currently using R(3.2.1), and having some problem with converting my dataset to numeric so to plot my time series graph.</p>
  
  <p>I read my data table extracted from a html page source, and have stored it in my global environment. 
  I can't convert my data.frame from character to numeric, and this is the example of heading of my data.</p>
  
  <pre><code>&gt; head(World)
      World  
  V3 "5,689"
  V4 "4,672"
  V5 "4,344"
  V6 "3,745"
  V7 "4,246"
  V8 "4,823"
  </code></pre>
  
  <p>This is my structure of data</p>
  
  <pre><code>&gt; str(World)
   'data.frame':  108 obs. of  1 variable:
   $ World: chr  "1,234" "1,234" "1,234" "4,321" ...
  </code></pre>
  
  <p>I would like to convert this data to time series, however, </p>
  
  <pre><code>ts(as.data.frame(sapply(World, function(x) gsub("\"", "", x))))
  </code></pre>
  
  <p>give me the integer values of the character type, such as</p>
  
  <pre><code>Time Series:
  Start = 1 
  End = 6 
  Frequency = 1 
       World
  [1,]    49
  [2,]    41
  [3,]    37
  [4,]    32
  [5,]    36
  [6,]    43
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code> as.numeric(as.character(World[,1]))
  </code></pre>
  
  <p>but it gave me NA values with Warning message: NAs introduced by coercion.</p>
  
  <p>I can see the value of World without quote, etc, however, when I use it as Time Series, the values change. </p>
  
  <p>I would like to my end product to be</p>
  
  <pre><code>Time Series:
  Start = 1 
  End = 6 
  Frequency = 1 
       World
  [1,]    5,689
  [2,]    4,672
  [3,]    4,333
  [4,]    3,745
  [5,]    4,246
  [6,]    4,823
  </code></pre>
  
  <p>I would appreciate any help given.</p>
  
  <p>Thanks</p>