我想讀一個.txt文件,希伯來語列名,但沒有成功。如何用「希伯來語」列名讀取(在R中)?
我上傳一個例子文件: http://www.talgalili.com/files/aa.txt
,我試圖命令:
read.table("http://www.talgalili.com/files/aa.txt", header = T, sep = "\t")
這將返回我:
X.....ª X...ª...... X...œ....
1 12 97 6
2 123 354 44
3 6 1 3
相反的:
אחת שתיים שלוש
12 97 6
123 354 44
6 1 3
我的輸出:
l10n_info()
是:
$MBCS
[1] FALSE
$`UTF-8`
[1] FALSE
$`Latin-1`
[1] TRUE
$codepage
[1] 1252
而且爲:
Sys.getlocale()
是:
[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
您能否提供給我什麼嘗試和改變讓我加載e文件是否正確?
更新: 嘗試使用:
read.table("http://www.talgalili.com/files/aa.txt",fileEncoding ="iso8859-8")
下了:
V1
1 ?
Warning messages:
1: In read.table("http://www.talgalili.com/files/aa.txt", fileEncoding = "iso8859-8") :
invalid input found on input connection 'http://www.talgalili.com/files/aa.txt'
2: In read.table("http://www.talgalili.com/files/aa.txt", fileEncoding = "iso8859-8") :
incomplete final line found by readTableHeader on 'http://www.talgalili.com/files/aa.txt'
雖然也試圖這樣的:
Sys.setlocale("LC_ALL", "en_US.UTF-8")
或者這樣:
Sys.setlocale("LC_ALL", "en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8")
獲取的我:
[1] ""
Warning message:
In Sys.setlocale("LC_ALL", "en_US.UTF-8") :
OS reports request to set locale to "en_US.UTF-8" cannot be honored
最後,這裏是> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32
locale:
[1] LC_COLLATE=English_United States.1255 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_2.10.1
任何建議或澄清將不勝感激。
最佳, 塔爾
你有沒有想過設置語言環境的方法?我遇到了同樣的問題,你需要將它設置爲使用'odfWeave' ... – Chase 2010-11-19 20:19:53