【发布时间】:2016-09-02 22:57:10
【问题描述】:
我在 R 中安装包 car 时遇到问题。
以前有关于该主题的帖子,包括this one和this other one。
我遵循了迄今为止遇到的建议,但没有成功。我正在使用 R 版本 3.2.2。和 RStudio。
这是我收到的消息:
install.packages("car")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/car_2.1-3.zip'
Content type 'application/zip' length 1447213 bytes (1.4 MB)
downloaded 1.4 MB
package ‘car’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
如果我检查我得到,
?car
No documentation for ‘car’ in specified packages and libraries:
you could try ‘??car’
我尝试使用 Install packages from local zip drives 从 R 安装它,并在 C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages 中寻找 zip,但结果如下:
library(car)
Error in library.dynam(lib, package, package.lib) :
DLL ‘SparseM’ not found: maybe not installed for this architecture?
In addition: Warning message:
package ‘car’ was built under R version 3.2.5
Error: package or namespace load failed for ‘car’
我确实尝试安装SparseM,甚至在没有成功发布 OP 之前:
> install.packages("SparseM")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/SparseM_1.7.zip'
Content type 'application/zip' length 795531 bytes (776 KB)
downloaded 776 KB
package ‘SparseM’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
> ?SparseM
No documentation for ‘SparseM’ in specified packages and libraries:
you could try ‘??SparseM’
跟进:
在对 R 版本 3.2.3 发表评论后,我认为只需下载此版本、安装并删除 3.2.2 即可轻松修复。那么问题是 RStudio 似乎没有工作。我卸载并重新安装了 R-studio,现在打开 R Studio 时得到了这个:
【问题讨论】:
-
你能升级你的 r 版本吗,因为一些导入包依赖于以后的 r 版本
-
您的错误信息可能不完整。在
car安装结果之前是否有消息提到了有关SparseM的内容?当我安装car时,我得到了对SparseM的显式依赖,因此如果它不适用于您的arch/Rversion,它将引发错误。 (也许尝试install.packages("SparseM")并使用结果编辑您的问题。) -
@r2evans;我认为问题将持续存在,因为它导入需要 R >3.2.3 的 pkbrtest
-
pkbrtest不包含在DESCRIPTION的任何位置,但现在我看到它确实安装了。你可能是对的,我只是在吃'SparseM' not found(R-3.2.2 仍然支持它)。也许SparseM是一个暂时失败的安装,另一次尝试会正常工作(这发生在我身上)。在 OP 回来编辑/cmets 之前不知道。 -
显然,我无法阅读。谢谢。 (其实是有阅读障碍的
grep,用这样的名字很容易做到。)
标签: r package installation