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

From: Peter Ehlers <ehlers_at_ucalgary.ca>
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
>



R-help_at_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. 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive