我在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:
sessionInfo()
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.app
和Library/Frameworks/R.framework
并再次安装R.
答案 0 :(得分:0)
可能是因为早期版本3.0的另一个R安装与sessionInfo()中显示的3.0.1相比?
FUN中的错误(结构(c(“write_png”,“read_png”),. Name = c(“write_png”,:没有这样的符号write_png 包/库/框架/ R.framework /版本/ 3.0 /资源/库/ PNG /库/ png.so 错误:'ggmap'
的包或命名空间加载失败
答案 1 :(得分:0)
转到RStudio - >选项 - >全局 - >'一般' - > R版本 将R版本更改为您要使用的最新版本。