Hello,
I am trying to read in an Excel file that I saved as a .csv so I can analyze
my assignment data! I am getting really frustrated because this is what I
keep getting:
Warning message:
In read.table("CityData.CSV", sep = "/", header = T) :
incomplete final line found by readTableHeader on 'CityData.CSV'
I have open the file and make sure click return after the last line, then
save the file.
I try to use kinds of read data frame methods, such as
read.table
read.csv or
my.files <- list.files("path")
for(i in my.files)
{
nam <- paste("CityData", substr(i, 14, 15), sep ='')
assign(nam, read.csv(i))
}
-------------------------
They all failed.
Can anyone offer some help? Thanks a lot!
--
View this message in context: http://r.789695.n4.nabble.com/incomplete-final-line-found-by-readTableHeader-tp4647259.html
Sent from the R help mailing list archive at Nabble.com.
incomplete final line found by readTableHeader
5 messages · Jeff Newmiller, Shane2012, David Winsemius +1 more
Keep in mind that this is NOT a homework support list... you are supposed to use the support provided by your educational institution if you are in a course. Read the posting guide mentioned in the footer of every email.
FWIW, as described your problem is with Excel, and this is not an Excel support list either. I suggest that you edit the csv file with a text editor (e.g. NotePad) to make sure the correct number of commas are on each line of the data file.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Shane2012 <wenbo520 at live.cn> wrote:
Hello,
I am trying to read in an Excel file that I saved as a .csv so I can
analyze
my assignment data! I am getting really frustrated because this is what
I
keep getting:
Warning message:
In read.table("CityData.CSV", sep = "/", header = T) :
incomplete final line found by readTableHeader on 'CityData.CSV'
I have open the file and make sure click return after the last line,
then
save the file.
I try to use kinds of read data frame methods, such as
read.table
read.csv or
my.files <- list.files("path")
for(i in my.files)
{
nam <- paste("CityData", substr(i, 14, 15), sep ='')
assign(nam, read.csv(i))
}
-------------------------
They all failed.
Can anyone offer some help? Thanks a lot!
--
View this message in context:
http://r.789695.n4.nabble.com/incomplete-final-line-found-by-readTableHeader-tp4647259.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________ 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.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121023/3c0d213f/attachment.pl>
On Oct 23, 2012, at 8:12 PM, Jeff Newmiller wrote:
Keep in mind that this is NOT a homework support list... you are supposed to use the support provided by your educational institution if you are in a course. Read the posting guide mentioned in the footer of every email. FWIW, as described your problem is with Excel, and this is not an Excel support list either. I suggest that you edit the csv file with a text editor (e.g. NotePad) to make sure the correct number of commas are on each line of the data file.
All true. Plus it's just a warning that the last line did not end with a <cr>. You should find that the data got into the object just fine. Warnings are NOT errors.
David.
> ---------------------------------------------------------------------------
> Jeff Newmiller The ..... ..... Go Live...
> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
> Live: OO#.. Dead: OO#.. Playing
> Research Engineer (Solar/Batteries O.O#. #.O#. with
> /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> Shane2012 <wenbo520 at live.cn> wrote:
>
>> Hello,
>>
>> I am trying to read in an Excel file that I saved as a .csv so I can
>> analyze
>> my assignment data! I am getting really frustrated because this is what
>> I
>> keep getting:
>> Warning message:
>> In read.table("CityData.CSV", sep = "/", header = T) :
>> incomplete final line found by readTableHeader on 'CityData.CSV'
>>
>> I have open the file and make sure click return after the last line,
>> then
>> save the file.
>>
>> I try to use kinds of read data frame methods, such as
>>
>> read.table
>>
>> read.csv or
>> my.files <- list.files("path")
>> for(i in my.files)
>> {
>> nam <- paste("CityData", substr(i, 14, 15), sep ='')
>> assign(nam, read.csv(i))
>> }
>> -------------------------
>> They all failed.
>>
>> Can anyone offer some help? Thanks a lot!
>>
>>
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/incomplete-final-line-found-by-readTableHeader-tp4647259.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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.
>
> ______________________________________________
> 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.
David Winsemius, MD
Alameda, CA, USA
Le mardi 23 octobre 2012 ? 20:36 -0700, Shane2012 a ?crit :
Thanks, Jeff This is from a course, but the course is just needed to take some slides for presentation. I just learn R by myself, and want this skill more practical. So I try to use the innovative way to perform a more professional presentation.hence, no worry about the homework support issue. However, I still got the problem, I think I did the right thing to make the excel, then change the extension to csv to make sure it has the appropriate comma in it.But the warning still be there. I will try other more. Thank you.
The warning is slightly ambiguous in this context. What it means is *not* "the record/observation/individual is incomplete, i.e. needs one more comma" but "the last line of the file is incomplete, i.e. does not end with a line break". This warning is completely innocuous in this case as David stated: you can get rid of it by opening your CSV file with a text editor and adding an empty line at the end of the file, but if you don't do this, things will work as expected. To make it short: you don't have any problem. ;-) Regards