Philippe Grosjean wrote: > The problem is often a misspecification of the comment.char argument. > For read.table(), it defaults to '#'. This means that everywhere you > have a '#' char in your Excel sheet, the rest of the line is ignored. > This results in a different number of items per line. > > You should better use read.csv() which provides better default arguments > for your particular problem. > Best, > > Or read.delim/read.delim2, which should be even better at TAB-separated files.
In general, be very suspicious of read.table() with such files, not only because of the '#' but also because it expects columns separated by _arbitrary_ amounts of whitespace. I.e., n TABs counts as one, so empty fields are skipped over. -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ 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.