title: Handling "NA", "$" and "," characters
body: <p>I have a dataframe with sales of 896 items from Monday to Saturday. Inside, there are some NA values and numbers such as for example $2,796.21. I read the txt file with:</p>
  
  <pre><code>mega1 &lt;- read.table("Report-WEEK 24112014.txt", sep=",", stringsAsFactors = FALSE, header = FALSE)
  </code></pre>
  
  <p>I want to get rid of the the NA values, the "$" and "," characters so I can perform my sales analysis. I used:</p>
  
  <pre><code>mega1[is.na(mega1)] &lt;- 0   # to replace the NAs by 0
  mega1$Monday &lt;- as.numeric(sub("\\$" ,"", mega1$Monday)) #as the same for the other days 
  </code></pre>
  
  <p>but R gave me:  Warning message: NAs introduced by coercion and the numbers such as $2796.21 has changed to NA. </p>
  
  <p>I would like some help. Thanks! </p>