Colleagues,
I am using R 2.4.0 on both a Mac (10.4.8) and Linux (RedHat 9). To
read data from an Excel spreadsheet, I do "save as" in Excel, then
select the "Text (tab-delimited)" format. The resulting file uses a
tab separator and I can usually read the file using read.delim.
Sometimes, the header row contains embedded carriage returns. When I
view the file, these carriage returns appear as "^M".
Now the problem:
When I read.delim these files, they do not read correctly. Sometimes
I get error messages; sometimes only the first line is read.
Interestingly, invoking the option skip=1 (or a larger N) does not
appear to bypass the problem.
I can solve the problem by manually deleting these carriage returns
either in the original Excel file or the .txt version. However,
this is not an ideal solution.
Does anyone have a work-around within R?
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.com
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.