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.us>wrote: > 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). > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > 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 >> 2 2 5 >> 3 2 6 >> > f$CEL_A >> NULL >> >> I'm not sure where the special character \ufeff comes from. Could anybody >> let me know what is the problem? >> >> Thanks, >> John >> >> [[alternative HTML version deleted]] >> ------------------------------ >> R-help@r-project.org mailing listhttps://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. >> >> [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.