2

我正在尝试在我的系统 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)

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

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 

有什么建议么???

4

2 回答 2

3

您可以在同一台计算机上安装更多 R,因此如果该软件包很重要,我建议您下载适当的版本,以便您可以使用它。

于 2013-07-16T09:45:46.457 回答
2

只是添加 NAMESPACE 文件真的很有帮助。

解压包,然后在解压包中创建一个 NAMESPACE 文件并写入'exportPattern(".")' 保存它。然后使用“tar -zcf package.tar.gz package” tar 包,然后尝试安装它。我尝试使用命令

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

并使用以下输出安装:

* 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)

非常感谢guyzz :)

于 2014-02-16T12:32:44.787 回答