我无法导入以下城市:日内瓦比拉赫等。我试过Stackoverflow上的解决方案,但似乎都不起作用。你有对你起作用的东西吗?谢谢你。
7ajki6be1#
尝试在read.csv函数中导入指定编码为encoding = "UTF-8"的文件。例如,data <- read.csv("your_file.csv", encoding = "UTF-8")。
read.csv
encoding = "UTF-8"
data <- read.csv("your_file.csv", encoding = "UTF-8")
krcsximq2#
尝试另一个Stackoverflow thread,其中OP首先尝试使用guess_encoding("you file name here")(来自readr包)猜测编码,然后尝试fileEncoding = "[whatever it gives you]",而不是在read.csv语句中写入encoding= "[whatever it gives you]"。顺便说一句,对我来说,有了“é”和“è",它给了我“ISO-8859-1”,我能够用正确的重音字符导入数据。
guess_encoding("you file name here")
readr
fileEncoding = "[whatever it gives you]"
encoding= "[whatever it gives you]"
2条答案
按热度按时间7ajki6be1#
尝试在
read.csv
函数中导入指定编码为encoding = "UTF-8"
的文件。例如,
data <- read.csv("your_file.csv", encoding = "UTF-8")
。krcsximq2#
尝试另一个Stackoverflow thread,其中OP首先尝试使用
guess_encoding("you file name here")
(来自readr
包)猜测编码,然后尝试fileEncoding = "[whatever it gives you]"
,而不是在read.csv
语句中写入encoding= "[whatever it gives you]"
。顺便说一句,对我来说,有了“é”和“è",它给了我“ISO-8859-1”,我能够用正确的重音字符导入数据。