[R] Problem when reading tables containing Unicode characters in Windows

Hilmar Berger hilmar.berger at integromics.com
Wed Apr 21 16:28:52 CEST 2010


Hi all,

I have a problem when trying to read text tables containing Unicode chars in
R 2.10.1 (WinXP, English locale).

An example file is attached.

The following command is supposed to read the table, but the data is only
read incompletely:

read.table("example_unicode.txt", sep="\t", dec=".", header=T, fileEncoding
= "UCS-2LE", fill=T)

  ID a  s  d
1  3 0 NA NA
Warning messages:
1: In read.table("example_unicode.txt", sep = "\t", dec = ".",  :
  invalid input found on input connection 'example_unicode.txt'
2: In read.table("example_unicode.txt", sep = "\t", dec = ".",  :
  incomplete final line found by readTableHeader on 'example_unicode.txt'

The offending unicode characters seem to be \u68ee \u9dd7 \u5916.

Any help is appreciated.

Best regards,
Hilmar
---
Hilmar Berger
Integromics S.L. / CNB-CSIC
Madrid, Spain
-------------- next part --------------
?ID	a	s	d
3	0	???	100
4	3,33	ø?????	200
5	50	"???	"	300


More information about the R-help mailing list