【发布时间】:2016-01-29 14:35:39
【问题描述】:
我正在尝试使用 R 的 read_csv() 读取 csv 文件。
library(readr)
data <- read_csv("data/tmp.csv")
tmp.csv 如下所示。
"A", "B", "C", "D", "E", "F", "G", "H", "I"
1,5,2015-07-31,5263,555,1,1,"0","1"
2,5,2015-07-31,6064,625,1,1,"0","1"
3,5,2015-07-31,8314,821,1,1,"0","1"
4,5,2015-07-31,13995,1498,1,1,"0","1"
5,5,2015-07-31,4822,559,1,1,"0","1"
6,5,2015-07-31,5651,589,1,1,"0","1"
7,5,2015-07-31,15344,1414,1,1,"0","1"
8,5,2015-07-31,8492,833,1,1,"0","1"
9,5,2015-07-31,8565,687,1,1,"0","1"
但它会产生以下错误。
Error in match(x, table, nomatch = 0L) :
could not find function "OlsonNames"
我该如何解决这个错误?我已经使用该错误进行了谷歌搜索,但没有找到任何相关的解决方案。
经过一番挖掘,同样的错误发生在:
> locale()
Error in match(x, table, nomatch = 0L) :
could not find function "OlsonNames"
这似乎是与https://stat.ethz.ch/R-manual/R-devel/library/base/html/timezones.html 相关的错误
重新启动 R 会话不起作用。
我应该如何解决这个错误?我需要安装一些软件包吗?如果有,是哪个?
【问题讨论】:
-
你试过
read.csv。我尝试使用read_csv并没有收到任何错误。我用 readr_0.2.2 -
我假设您指的是
readr::read_csv? 说出来。 -
我认为你的会话搞砸了。
OlsonNames好像没有关系,就算有,你也应该有这个功能。尝试重新启动您的 R 会话。 -
find("read_csv")的结果是什么? -
@DavidArenburg 不,这是相关的:
readr::read_csv调用locale,后者又调用check_tz,后者使用OlsonNames。是的,R 会话似乎搞砸了。