title: R replace 'xxxxxx' string while reading a text file
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3357743/replacing-character-values-with-na-in-a-data-frame">Replacing character values with NA in a data frame</a>  </p>
  </blockquote>
  
  
  
  <p>I am reading a txt file with character and numeric values in each rows.  Some of the missing values have been coded as xxxxxx in the file.  I want to replace them by na in the data frame. Given below is a soecific row of the data frame i read in:</p>
  
  <pre><code>mydf[199,]
      season  size  speed    mxPH    mnO2      C1     NO3     NH4    oPO4     PO4
  199 winter large medium 8.00000 7.60000 XXXXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXXX
        Chla1 a1   a2  a3 a4 a5 a6  a7
  199 XXXXXXX  0 12.5 3.7  1  0  0 4.9
  </code></pre>
  
  <p>I cant seem to replace the x's with na.
  Any help is greatly apprecisted!!!</p>