title: replace comma with dot in scientific notation in r
body: <p>I want to read a csv-file that uses scientific notation and comma as a decimal separator into a data frame or vector. Then I want to use this data for further calculations. The problem is that R does not recognize the data as numeric. How can I translate this scientific notation with commas into the "correct" scientific notation with dots so I can use as numeric values?</p>
  
  <p>I tried the following:</p>
  
  <p><code>mferg_1&lt;-read.csv("file.csv",sep=";",dec=",",header=FALSE)</code></p>
  
  <p>When I look at the dataframe <code>mferg_1</code> the following appears (excerpt):</p>
  
  <pre><code>          V2        V3        V4        V5
  14 3,063E+01 1,775E-02 6,641E-07 3,747E-02
  </code></pre>
  
  <p>I thought that I could replace the commas by using <code>gsub</code> or <code>sub</code>:</p>
  
  <p><code>mferg_1&lt;-sub(",",".",mferg_1)</code></p>
  
  <p>But then <code>mferg_1</code> looks like this:</p>
  
  <pre><code>[1] "425" "388" "535" "472"
  </code></pre>
  
  <p>I fear there is an easy way to solve this problem but I have not been able to find it.</p>