title: gsub function in R doesn't replace
body: <p>Please anyone tell me what the problem is here? I have data where between digits there is whitespace. For example, instead <code>1234.00</code>, I have <code>1 234.00</code>. I must replace that <code>" " with ""</code>, using the <code>gsub</code> function in R.  </p>
  
  <p>I wrote this function:</p>
  
  <pre><code>data(mydata)
  
  fixup.num &lt;- function(x) 
      as.numeric(gsub(pattern = " ", replacement = "", x, fixed = TRUE))
  
  fixup.num(mydata$safety)
  </code></pre>
  
  <p>But after it's done, I can see that the spaces weren't replaced and <code>mydata</code> has not changed. Where am I doing wrong?</p>