[R] Reading a file with mixed cyrillic/latin characters

Stephan Kolassa Stephan.Kolassa at gmx.de
Tue Jan 12 12:25:24 CET 2010


Dear useRs,

I am trying to read a tab-delimited Unicode text file containing both 
latin and cyrillic characters and failing miserably. The file looks like 
this (I hope it comes across right):

A	B	C
3	foo	ФОО
5	bar	БАР

read.table("foo.txt",sep="\t",header=TRUE)

I am guessing that I can use the fileEncoding argument to read.table() 
to read this, but I can find no list of supported values of 
fileEncoding, and fileEncoding="Unicode" gives an error.

The FAQ and the FAQ for Windows don't help. I have searched both the 
list archives and RSeek and am still seeking enlightenment. I am running 
R 2.10.1 on Windows XP, sessionInfo() below.

Cheers
Stephan


R version 2.10.1 (2009-12-14)
i386-pc-mingw32

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252 
LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base



More information about the R-help mailing list