在R中安装包抛出“包不可用(对于R版本3.0.1)”[重复]

时间:2021-12-18 13:55:04

This question already has an answer here:

这个问题已经有了答案:

I am trying to install the following R package on my system Ubuntu 12.04 x86_64-pc-linux-gnu but it seems that my R version is higher and I am downloading a package supported on previous version...I am getting a waning:

我正在尝试在我的系统Ubuntu 12.04 x86_64-pc-linux-gnu上安装以下R包,但是看起来我的R版本更高了,我正在下载上一个版本支持的包……我在变弱:

install.packages("Spot")

Warning in install.packages :
package ‘Spot’ is not available (for R version 3.0.1)

I tried to install it from Package archive but it giving me this error

我试图从包归档中安装它,但它给了我这个错误

install.packages("~/Spot_3.2_x86_64.tar.gz", repos = NULL, type = "source", lib="/home/jarvis/R/x86_64-pc-linux-gnu-library/3.0")

Warning in install.packages :
package ‘~/R/workspace/Spot_3.2_x86_64.tar.gz’ is not available (for R version 3.0.1)
* installing *source* package ‘Spot’ ...
ERROR: a 'NAMESPACE' file is required
* removing ‘/home/jarvis/R/x86_64-pc-linux-gnu-library/3.0/Spot’
Warning in install.packages :
installation of package ‘/home/jarvis/R/workspace/Spot_3.2_x86_64.tar.gz’ had non-zero    exit status 

any suggestions???

有什么建议吗? ? ?

2 个解决方案

#1


3  

you can have more R installations on same computer so i would suggest downloading appropriate version if that package is important so you can use it.

你可以在同一台电脑上安装更多的R,所以如果这个包很重要,我建议你下载合适的版本,这样你就可以使用它了。

#2


2  

Just adding the NAMESPACE file really helped.

仅仅添加名称空间文件就非常有帮助。

Untar the package, then create a NAMESPACE file in the untarred package and write 'exportPattern(".")' save it. Then tar the package using "tar -zcf package.tar.gz package" and then try to install it. I tried with the command

解压缩包,然后在未标记的包中创建一个名称空间文件,并写入'exportPattern(".")'保存它。然后使用“tar -zcf package.tar”对包装进行tar处理。然后尝试安装它。我试着指挥。

install.packages("~/R/workspace/Spot.tar.gz", repos = NULL, type = "source", lib="~/R/x86_64-pc-linux-gnu-library/3.0")

and it gets installed with the follwing output:

安装后输出如下:

* installing *source* package ‘Spot’ ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
‘Spot.Rnw’ 
** testing if installed package can be loaded
Warning: ignoring .First.lib() for package ‘Spot’
* DONE (Spot)

Thanks alot guyzz :)

谢谢guyzz:)

#1


3  

you can have more R installations on same computer so i would suggest downloading appropriate version if that package is important so you can use it.

你可以在同一台电脑上安装更多的R,所以如果这个包很重要,我建议你下载合适的版本,这样你就可以使用它了。

#2


2  

Just adding the NAMESPACE file really helped.

仅仅添加名称空间文件就非常有帮助。

Untar the package, then create a NAMESPACE file in the untarred package and write 'exportPattern(".")' save it. Then tar the package using "tar -zcf package.tar.gz package" and then try to install it. I tried with the command

解压缩包,然后在未标记的包中创建一个名称空间文件,并写入'exportPattern(".")'保存它。然后使用“tar -zcf package.tar”对包装进行tar处理。然后尝试安装它。我试着指挥。

install.packages("~/R/workspace/Spot.tar.gz", repos = NULL, type = "source", lib="~/R/x86_64-pc-linux-gnu-library/3.0")

and it gets installed with the follwing output:

安装后输出如下:

* installing *source* package ‘Spot’ ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
‘Spot.Rnw’ 
** testing if installed package can be loaded
Warning: ignoring .First.lib() for package ‘Spot’
* DONE (Spot)

Thanks alot guyzz :)

谢谢guyzz:)