尝试在R中加载库(ggplot2)时出错 [英] Error when trying to load library(ggplot2) in R
问题描述
我无法在R中加载ggplot2库。下面是我输入的代码。任何人有任何想法如何使这项工作?
>库(ggplot2)
错误get(x,envir = this,inherits = inh):
未使用的参数(s)(envir = this,inherits = inh)
错误:无法在程序包'ggplot2'中加载R代码
错误:'ggplot2'程序包/名称空间加载失败
编辑1:更多信息
> sessionInfo()
R版本2.13.0(2011-04-13)
平台:x86_64-apple-darwin9.8.0 / x86_64(64位)
语言环境:
[1] en_US.UTF-8 / en_US.UTF-8 / C / C / en_US.UTF-8 / en_US.UTF-8
附加基础套餐:
[ 1] grid stats graphics grDevices utils数据集方法基数
其他附加软件包:
[1] quantmod_0.3-15 TTR_0.20-2 xts_0.8-0 zoo_1.6-5 Defaults_1 .1-1
[6] reshape2_1.1 proto_0.3-9.2 reshape_0.8.4 plyr_1.5.2
通过命名空间加载(并未附加):
[1] lattice_0.19-26 stringr_0.4 tools_2.13.0
编辑2:
我尝试使用的ggplot2版本是0.8.9。当我调用回溯函数时,我得到以下结果:
> traceback()
2:stop(gettextf(package / namespace load for'%s',package),
call。= FALSE,domain = NA)
1:library( ggplot2)
退出R.进入 /Library/Frameworks/R.framework/Versions/2.13/Resources/library/
目录并垃圾整个文件夹。如果您有其他库,请确保它们没有任何副本。重新启动R并重新安装,并确保您安装了所有依赖项。 GUI Package Installer中有一个复选标记选项,或者您可以使用(在命令行中:install.packages(ggplot2,dependencies = c(Depends,Imports,Suggests))。
进一步思考:
有时可以通过修复磁盘权限来解决MacOS中的模糊错误,Disk Utility.app程序就是我通常使用的方式。它是一个定期的基础上,虽然我只这样做时出现问题,似乎是一个文件访问问题。
I'm having trouble loading the ggplot2 library in R. Below is the code that I type in. Anyone have any ideas on how to make this work?
> library(ggplot2)
Error in get(x, envir = this, inherits = inh) :
unused argument(s) (envir = this, inherits = inh)
Error : unable to load R code in package 'ggplot2'
Error: package/namespace load failed for 'ggplot2'
Edit 1: More Info
> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] quantmod_0.3-15 TTR_0.20-2 xts_0.8-0 zoo_1.6-5 Defaults_1.1-1
[6] reshape2_1.1 proto_0.3-9.2 reshape_0.8.4 plyr_1.5.2
loaded via a namespace (and not attached):
[1] lattice_0.19-26 stringr_0.4 tools_2.13.0
Edit 2:
The version of ggplot2 that I'm trying to use is 0.8.9. When I call the traceback function I get the following result:
> traceback()
2: stop(gettextf("package/namespace load failed for '%s'", package),
call. = FALSE, domain = NA)
1: library(ggplot2)
Quit R. Go into your /Library/Frameworks/R.framework/Versions/2.13/Resources/library/
directory and trash the entire folder. If you have any other libraries make sure they don't have any copies, either. Restart R and reinstall and make sure you install all dependencies. There is a check mark option in the GUI Package Installer or you can use (at the command line: install.packages("ggplot2", dependencies=c("Depends", "Imports", "Suggests") ).
Further thought: Obscure errors in the MacOS can sometimes be resolved by repairing disk permissions. The Disk Utility.app program is the way I usually do it. Some people run it on a regular basis although I only do so when a problem arises that seems to be a file access issue.
这篇关于尝试在R中加载库(ggplot2)时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!