简体   繁体   English

未能安装kernlab软件包R.

[英]Failure to install kernlab package R.

I know other people have asked this question... but no one has really offered a solution. 我知道其他人已经问过这个问题......但没有人真正提出过解决方案。

I am trying to install the Kernlab R package, and I get this: 我正在尝试安装Kernlab R包,我得到了这个:

..... .....

install.packages("kernlab")
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.0/kernlab_0.9-19.zip'
Content type 'application/zip' length 2029405 bytes (1.9 Mb)
opened URL
downloaded 1.9 Mb

Warning in install.packages :
  downloaded length 1978368 != reported length 2029405
Warning in install.packages :
  error 1 in extracting from zip file
Warning in install.packages :
  cannot open compressed file 'kernlab/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection

........

I tried downloading the zip file and opening it from the computer, but it says that the files from the CRAN repository are corrupted. 我尝试下载zip文件并从计算机打开它,但它说CRAN存储库中的文件已损坏。 I tried winrar, unzipping the folder, etc. 我试过winrar,解压缩文件夹等。

I have to use this for the Data Analysis Coursera course and posted the question there. 我必须将它用于数据分析Coursera课程并在那里发布问题。 No one has answered yet. 还没有人回答。

Does anyone know what might be the problem? 有谁知道可能是什么问题?

Thanks in advance, Felipe 菲利普,提前谢谢

To install kernlab package: Download the kernlab binaries for your OS. 要安装kernlab软件包: 下载适用于您的操作系统的kernlab二进制文件。 Then open a terminal and type: 然后打开一个终端并键入:

$R CMD INSTALL kernlab_0.9-19.tar

Then go to R and use it directly by issuing the command: 然后转到R并通过发出命令直接使用它:

library(kernlab)

我从https://cran.r-project.org/web/packages/kernlab/index.html和unrar下载了:Documents Folder \\ R \\ win-library \\ 3.2 \\ kernlab并准备就绪。

I faced the same issue, tried installing the package on the R console and not R studio and then use the package in R studio. 我遇到了同样的问题,尝试在R控制台上安装软件包而不是R studio,然后在R studio中使用该软件包。 Now sure why or how it works, but it worked for me. 现在确定它为什么或如何工作,但它对我有用。

Had this issue on EC2 在EC2上有这个问题

Installed after I made a few links. 我做了几个链接后安装。

R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-redhat-linux-gnu (64-bit) R版本3.2.2(2015-08-14) - “消防安全”版权所有(C)2015统计计算平台的R基础:x86_64-redhat-linux-gnu(64位)

ln -s /usr/lib64/R/modules/lapack.so /usr/lib64/R/lib/libRlapack.so ln -s /usr/lib64/R/modules/lapack.so /usr/lib64/R/lib/libRlapack.so

ln -s /usr/lib64/libblas.so /usr/lib64/R/lib/libRblas.so ln -s /usr/lib64/libblas.so /usr/lib64/R/lib/libRblas.so

ln -s /usr/lib64/libgfortran.so.3.0.0 /usr/lib64/R/lib/libgfortran.so ln -s /usr/lib64/libgfortran.so.3.0.0 /usr/lib64/R/lib/libgfortran.so

ln -s /usr/lib64/libquadmath.so.0.0.0 /usr/lib64/R/lib/libquadmath.so ln -s /usr/lib64/libquadmath.so.0.0.0 /usr/lib64/R/lib/libquadmath.so

I just tried installing in RStudio; 我刚尝试在RStudio中安装; it works fine: 它工作正常:

install.packages("kernlab")

Here is my version of RStudio: 这是我的RStudio版本:

Version 0.99.489 – © 2009-2015 RStudio, Inc.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko)

I have run into similar issues in the past. 我过去遇到过类似的问题。 This error can occur when the "login" information is unset for R, in which case you may not have the right permissions for /tmp/ What does your Sys.info() response look like? 当R的“login”信息未设置时,可能会发生此错误,在这种情况下,您可能没有/ tmp /您的Sys.info()响应是什么样的权限? If you have login as "unknown", you can get said permission errors. 如果您登录为“未知”,则可以获得所述权限错误。 Example: 例:

                                   sysname 
                                   "Linux" 
                                   release 
                                 <release>
                                   version 
                             <version info>
                                  nodename 
                                    <nodename> 
                                   machine 
                                  "x86_64" 
                                     login 
                                   "unknown"
                                      user 
                                   <your name> 
                            effective_user 
                                   <your name> 

You can set the login through making sure R is being passed the correct user / uid. 您可以通过确保R正在传递正确的用户/ uid来设置登录。 You can often set this info in .conf files for tools such as Rstudio, Rserve, etc. 您通常可以在.conf文件中为Rstudio,Rserve等工具设置此信息。

I actually fixed this one eventually... My laptop at the time had a really weird virus that wouldn't let me install anything, even packages. 我实际上最终解决了这个...我的笔记本电脑当时有一个非常奇怪的病毒,不允许我安装任何东西,甚至包。

It was a really old laptop, but I basically removed the virus from the PC, and I got it work. 这是一台非常古老的笔记本电脑,但我基本上从PC上删除了病毒,而且我得到了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM