Re: [R] How to read data from this csv?

From: Peter Ehlers <>
Date: Sat, 19 Jun 2010 00:02:14 -0600

On 2010-06-18 23:22, YI LIU wrote:
> I am so frustrated about reading data from this sample csv file.
> My code is :
>> test=read.csv(file='test.csv',header=T)
> warning message:
> In read.table(file = file, header = header, sep = sep, quote = quote, :
> incomplete final line found by readTableHeader on 'test.csv'
>> test
> [1] ...
> <0 rows> (or 0-length row.names)
> What is the problem here?

No need to get frustrated; your file is not what you think it is.

Most likely at least one of the lines in test.csv is _not_ complete, i.e. it's missing some data, which is what R is trying to tell you.

Try count.fields() on your file and see if all lines do have the same number of fields.

   -Peter Ehlers

> Thanks
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sat 19 Jun 2010 - 06:04:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Jun 2010 - 07:00:33 GMT.

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

list of date sections of archive