I tried it on R 4.4.1 on Linux Mint 21.3 just before I posted it, and I just
tried it on R 3.4.2 on Ubuntu 16.04 and R 4.3.2 on Windows 11 just now and it
works on all of them.
I don't have a big-endian machine to test on, but the Unicode spec says to
honor the BOM and if there isn't one to ass
On 2024-09-07 4:52 p.m., Jeff Newmiller via R-help wrote:
When you specify LE in the encoding type, you are logically telling the decoder
that you know the two-byte pairs are in little-endian order... which could
override whatever the byte-order-mark was indicating. If the BOM indicated
big-en
When you specify LE in the encoding type, you are logically telling the decoder
that you know the two-byte pairs are in little-endian order... which could
override whatever the byte-order-mark was indicating. If the BOM indicated
big-endian then the file decoding would break. If there is a BOM,
Add the
fileEncoding = "UTF-16"
argument to the read call.
For a human explanation of why this is going on I recommend [1]. For a more
R-related take, try [2].
For reference, I downloaded your file and used the "file" command line program
typically available on Linux (and possibly MacOSX)
Ha, the proper answer!
Thanks for this, Iris. I followed up by consulting the Wikipedia "byte
order mark" entry and learned something I knew nothing about.
FWIW, if I had simply searched on t it would have immediately led
me to BOMs.
Best,
Bert
On Sat, Sep 7, 2024 at 1:30 PM Iris Simmons wrote:
On Sun, 08 Sep 2024, Christofer Bogaso writes:
> Hi,
>
> I am trying to the data from
> https://online.stat.psu.edu/onlinecourses/sites/stat501/files/ch15/employee.txt
> without any success. Below is the error I am getting:
>
>> read.delim('https://online.stat.psu.edu/onlinecourses/sites/stat501/f
That looks like a UTF-16LE byte order mark. Simply open the connection
with the proper encoding:
read.delim(
'https://online.stat.psu.edu/onlinecourses/sites/stat501/files/ch15/employee.txt',
fileEncoding = "UTF-16LE"
)
On Sat, Sep 7, 2024 at 3:57 PM Christofer Bogaso
wrote:
>
> Hi,
>
>
Well, this is frankly an unsatisfactory answer, as it does not try to deal
properly with the issues that you experienced, which I also did. However,
it's simple and works. As this is a small text file,
simply copy it in your browser to the clipboard, and then use:
thefile <- read.table(text =
"", h
Hi,
I am trying to the data from
https://online.stat.psu.edu/onlinecourses/sites/stat501/files/ch15/employee.txt
without any success. Below is the error I am getting:
> read.delim('https://online.stat.psu.edu/onlinecourses/sites/stat501/files/ch15/employee.txt')
Error in make.names(col.names, un
> Richard O'Keefe
> on Sat, 7 Sep 2024 02:40:29 +1200 writes:
> G.5.1 para 2 can be found in the C17 standard -- I
> actually have the final draft not the published standard.
Ok. Thank you.
A direct hopefully stable link to that final draft's Appendix G
seems to be
h
10 matches
Mail list logo