An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20110601/9af788e6/attachment.pl>
read.csv and FileEncoding in Windows version of R 2.13.0
3 messages · Duncan Murdoch, Alexander Peterhansl
On 01/06/2011 6:00 PM, Alexander Peterhansl wrote:
Dear R-devel List:
read.csv() seems to have changed in R version 2.13.0 as compared to version 2.12.2 when reading in simple CSV files.
Suppose I read in a 2-column CSV file ("test.csv"), say
1, a
2, b
If file is encoded as UTF-8 (on Windows 7), then under R 2.13.0
That file could be pure ASCII, or could include a byte order mark. I tried both, and I didn't get the error your saw. So I think I need to see the file to diagnose this. Could you put it in a .zip file and email it to me? Duncan Murdoch
read.csv("test.csv",fileEncoding="UTF-8",header=FALSE) yields the following output
V1
1 ?
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'test.csv'
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'test.csv'
Under R 2.12.2 it runs problem-free and yields the expected:
V1 V2
1 1 a
2 2 b
Please help.
Regards,
Alex
[[alternative HTML version deleted]]
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
4 days later
Hello Duncan, thank you very much for your reply. The file is attached.
Again, the issue is that opening this UTF-8 encoded file under R 2.13.0 yields an error, but opening it under R 2.12.2 works without any issues.
The command I used to open the file is:
read.csv("test.csv",fileEncoding="UTF-8",header=FALSE)
(As you'll see, the file does have a byte order mark.)
Regards,
Alex
-----Original Message-----
From: Duncan Murdoch [mailto:murdoch.duncan at gmail.com]
Sent: Wednesday, June 01, 2011 7:35 PM
To: Alexander Peterhansl
Cc: R-devel at r-project.org
Subject: Re: [Rd] read.csv and FileEncoding in Windows version of R 2.13.0
On 01/06/2011 6:00 PM, Alexander Peterhansl wrote:
Dear R-devel List:
read.csv() seems to have changed in R version 2.13.0 as compared to version 2.12.2 when reading in simple CSV files.
Suppose I read in a 2-column CSV file ("test.csv"), say 1, a 2, b
If file is encoded as UTF-8 (on Windows 7), then under R 2.13.0
That file could be pure ASCII, or could include a byte order mark. I tried both, and I didn't get the error your saw. So I think I need to see the file to diagnose this. Could you put it in a .zip file and email it to me? Duncan Murdoch
read.csv("test.csv",fileEncoding="UTF-8",header=FALSE) yields the following output
V1
1 ?
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'test.csv'
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'test.csv'
Under R 2.12.2 it runs problem-free and yields the expected:
V1 V2
1 1 a
2 2 b
Please help.
Regards,
Alex
[[alternative HTML version deleted]]
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel