[R] Weird error (special character) of read.table

2011-02-22 Thread John Edwards
Hi, I have the following input file. $ cat main.txt CEL_A CELL_B 1 4 2 5 2 6 Then I run read.table in R. f=read.table('main.txt', header=T, check.names=F, sep='\t') head(f) \ufeffCEL_A CELL_B 11 4 22 5 32 6 f$CEL_A NULL I'm not sure where the special character

Re: [R] Weird error (special character) of read.table

2011-02-22 Thread Duncan Murdoch
On 22/02/2011 10:43 AM, John Edwards wrote: Hi, I have the following input file. $ cat main.txt CEL_A CELL_B 1 4 2 5 2 6 Then I run read.table in R. f=read.table('main.txt', header=T, check.names=F, sep='\t') head(f) \ufeffCEL_A CELL_B 11 4 22 5 32 6

Re: [R] Weird error (special character) of read.table

2011-02-22 Thread Jeff Newmiller
What you describe could be a bug (in which case providing your OS and R version info per the posting guidelines would be a minimum requirement to get it fixed) or a control character that is actually in your file (which you might need a binary editor to see).

Re: [R] Weird error (special character) of read.table

2011-02-22 Thread Henrik Bengtsson
On Tue, Feb 22, 2011 at 7:43 AM, John Edwards jhnedwards...@gmail.com wrote: Hi, I have the following input file. $ cat main.txt CEL_A CELL_B 1 4 2 5 2 6 Then I run read.table in R. f=read.table('main.txt', header=T, check.names=F, sep='\t') head(f)  \ufeffCEL_A CELL_B 1    1      4

Re: [R] Weird error (special character) of read.table

2011-02-22 Thread John Edwards
Thanks for all the people that replied my message. The text file indeed has \uFEFF. I have fixed the text file by using 'gvim -b'. On Tue, Feb 22, 2011 at 10:03 AM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote: What you describe could be a bug (in which case providing your OS and R version

Re: [R] Weird error (special character) of read.table

2011-02-22 Thread Prof Brian Ripley
And how to read a file with a BOM is actually discussed in detail in the 'R Data Import/Export' manual of 2.12.2 RC. What should be ASCII files with BOMs seem to be cropping up rather frequently these days: the recent culprits are Mac applications with origins on Windows (SPSS was one, some