1

我已经在 R (ggmap) 中安装了一个包,但是当我尝试使用它时,R 给出了一个错误:

> library()

... (all the rest)
gdata                   Various R programming tools for data
                        manipulation
ggmap                   A package for spatial visualization with Google
                        Maps and OpenStreetMap
ggplot2                 An implementation of the Grammar of Graphics
...

> library("ggmap")
Error in FUN(structure(c("write_png", "read_png"), .Names = c("write_png",  : 
  no such symbol write_png in package/Library/Frameworks/R.framework/Versions/3.0/Resources/library/png/libs/png.so
Error: package or namespace load failed for 'ggmap'

有什么建议吗?谢谢!

PD:

会话信息()

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] C

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

编辑,解决方案:

删除~/Applications/R.appLibrary/Frameworks/R.framework再次安装 R。

4

2 回答 2

0

可能是您的 sessionInfo() 中显示的早期版本 3.0 与 3.0.1 的另一个 R 安装?

FUN中的错误(结构(c(“write_png”,“read_png”),.Names = c(“write_png”,:包/库/框架/R.framework/Versions/3.0/Resources/library/中没有这样的符号write_png) png/libs/png.so 错误:“ggmap”的包或命名空间加载失败

于 2013-09-02T20:50:41.367 回答
0

转到 RStudio-->Options-->Global-->'General'-->R Version 将 R 版本更改为您要使用的最新版本。

于 2017-11-22T06:59:42.353 回答