Possible Duplicate:
Replacing character values with NA in a data frame
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:
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
I cant seem to replace the x's with na. Any help is greatly apprecisted!!!