Re: [R] Row limit for read.table

From: Frank McCown <>
Date: Wed 17 Jan 2007 - 17:22:40 GMT

> In your case, read.table behaves as documented.
> The ' - character is one of the standard quoting characters. Some (but
> very few) of the entrys contain single ' chars, so sometimes more than
> ten thousand lines are just treated as a single entry. Try using
> quote="" to disable quoting, as documented on the help page:
> f<-read.table("",
> header=TRUE, nrows=123000, comment.char="", sep="\t",quote="")
> length(f$change_rate)
> [1] 122271

So either adding quote="" works or removing sep="\t" (and not using quote) works. It seems an odd side-effect that specifying the separator changes the default behavior of quoting (because of the ' character). I don't see that association made in the help file.

> There is (colClasses, works as documented). Try
> f<-read.table("",
> + header=TRUE, nrows=123000, comment.char="",
> sep="\t",quote="",colClasses=c("character","NULL","NULL","NULL","NULL"))
> > dim(f)
> [1] 122271 1

> Did you read the help page?

Of course I did. For me the definition of colClasses wasn't clear... "A vector of classes to be assumed for the columns" didn't seem to be the same thing as "the columns you would like to be read." I may have made the association if the help page had contained a simple example of using colClasses.

Thanks for the help,

Frank McCown
Old Dominion University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Jan 18 04:28:03 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 17 Jan 2007 - 17:30:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.