[R] Encoding issue

Dennis Fisher fisher at plessthan.com
Mon Jan 6 18:38:48 CET 2014

R 3.0.2


I know little about encoding so please be patient with this question.  I have a CSV file created from a SAS7BDAT dataset (using Shotwell's SAS7BDAT package).  In the CSV file, when opened with XL, one entry reads as:

When I read this into R, that entry becomes:

I assume (perhaps naively) that this is a recoding.  Whenever this occurs, I would like to use "sub" to replace the first portion of the string with micro (so the entire string reads micromol/L).  However, when I use grep to identify presence of the string, R does not appear to detect it consistently.  Perhaps I am not escaping things correctly or perhaps my understanding of this encoding is flawed.

Can anyone provide some useful pointers here?


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)

More information about the R-help mailing list