[R] Read.table - Less rows than original data

Ben Bolker bolker at ufl.edu
Wed Jul 9 22:17:00 CEST 2008

phoebe kong <sityeekong <at> gmail.com> writes:

> I built a 1,273,230 by 6 data set named "mydata2", it was saved in the
> following command,
> write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t")
> The next day I read in above saved text file into R,
> temp<-read.table("mydata2.txt",header=T,sep="\t",na.strings="NA")
> However, the dimension of "temp" is 636,615 X 6.

  A long shot: do you by any chance have any "#" characters
in your data set?  If they all occurred for the first time
in column number 636,616 that would produce the observed
problem.  If so, set comment.char="".  

  Does this happen if you generate a random data set?

  Ben Bolker

More information about the R-help mailing list