title: Convert character variables into numeric with R
body: <p>FIRST QUESTION EVER ;)</p>
  <p>Here's the point: I have this dataset and I started without &quot;stringsAsFactors=FALSE&quot; in read.csv function. I can't work with those data because I got the Warning message: NAs introduced by coercion. Thank you for the help :)</p>
  <pre><code>rm(list=ls())
  
  path &lt;- &quot;.....&quot;
  file &lt;- read.csv(path, header = TRUE, sep = &quot;,&quot;, stringsAsFactors=FALSE)
  
  str(file)
  #'data.frame':  33 obs. of  11 variables:
  #$ Var1: chr  &quot;01/09/2021&quot; &quot;02/09/2021&quot; &quot;09/09/2021&quot; &quot;10/09/2021&quot; ...
  #$ Var2: chr  &quot;mercoledÃ¬&quot; &quot;giovedÃ¬&quot; &quot;giovedÃ¬&quot; &quot;venerdÃ¬&quot; ...
  #$ Var3: chr  &quot;2,5&quot; &quot;2,5&quot; &quot;2,5&quot; &quot;3,0&quot; ...
  #$ Var4: chr  &quot;4,0&quot; &quot;0,0&quot; &quot;2,0&quot; &quot;3,0&quot; ...
  #$ Var5: chr  &quot;2,0&quot; &quot;5,0&quot; &quot;5,0&quot; &quot;5,0&quot; ...
  #$ Var5: chr  &quot;0,0&quot; &quot;0,0&quot; &quot;0,0&quot; &quot;0,0&quot; ...
  #$ Var6: chr  &quot;6,0&quot; &quot;5,0&quot; &quot;7,0&quot; &quot;8,0&quot; ...
  #$ Var7: chr  &quot;23,5&quot; &quot;25,0&quot; &quot;28,0&quot; &quot;32,0&quot; ...
  #$ Var8: chr  &quot;0,0&quot; &quot;1,0&quot; &quot;5,0&quot; &quot;5,5&quot; ...
  #$ Var9: chr  &quot;23,5&quot; &quot;26,0&quot; &quot;33,0&quot; &quot;37,5&quot; ...
  #$ Var10: chr  &quot;67,0&quot; &quot;0,0&quot; &quot;0,0&quot; &quot;0,0&quot; ...
  
  as.numeric(file$Var7)
  </code></pre>
  <hr />
  <p><a href="https://i.stack.imgur.com/xLUr4.png" rel="nofollow noreferrer">1</a> NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
  Warning message:
  NAs introduced by coercion</p>
  <p><a href="https://i.stack.imgur.com/PDtnG.png" rel="nofollow noreferrer">CSV FILE</a></p>