[R] count.fields vs read.table

From: Andrew C. Ward <acward_at_tpg.com.au>
Date: Mon 05 Dec 2005 - 12:03:48 EST

Dear R-help,

I am using R 2.1.1 on Windows XP.

I have a tab-delimited data file that has been exported by SAS. The file is reasonably big so I apologise that I can't give a good toy example. I do this:

      table(count.fields("t1.txt", sep="\t", quote="\""))

So I have 809 lines, each with 248 fields.

There's something wrong with me, my data or both, since when I try to read the data, I get this:

      dim(read.table("t1.txt", sep="\t", quote="\"", header=TRUE)
      [1] 425 248

I wonder if someone could be kind enough to point out what I've done wrong or suggest some tips for managing this, please? Thanks for your advice!


Andrew C. Ward

Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Dec 05 13:02:43 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:28 EST