将包含德语变音符号的CSV文件导入到R中 [英] import CSV Files containing German Umlauts into R
问题描述
我正在使用R Studio,需要导入用于文本挖掘的csv文件。
文件是windows-1252编码并包含德语元音。
I am working with R Studio and need to import a csv File for Text mining. The File is windows-1252 encoded and contains German Umlauts.
但是我无法让R正确导入这些元音。使用read.table(X,fileEncoding =UTF-8)会导致错误。
However I cannot get R to import these Umlauts correctly. using read.table(X,fileEncoding="UTF-8") results in an error.
我缺少什么?
----更新----
----UPDATE----
我想要阅读的文件是:
https://drive.google.com/file/d/0B4kGh2YwTmb9U3hkei1TTHlUME0/edit?usp=sharing
The File I am trying to read is: https://drive.google.com/file/d/0B4kGh2YwTmb9U3hkei1TTHlUME0/edit?usp=sharing
使用此R代码:
Sys.setlocale(LC_CTYPE,german)
数据集< - read.table(../ processed /DE_all_CDM_201405050001_DE_all_CDM2014-05-05_rcout.csv,encoding =UTF-8,header = TRUE,sep =;,stringsAsFactors = F,as.is = T)
dataset< - dataset [,c (1,11,30)]
编码(数据集[,2])< - UTF-8
推荐答案
好的,我刚发现这是一个R Studio GUI问题。如果我在R控制台中运行我的代码就可以了。
Ok, I just found out that this is a R Studio GUI issue. If I run my code in the R console it würls fine.
这篇关于将包含德语变音符号的CSV文件导入到R中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!