我正在尝试在我的系统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)
我尝试从Package archive安装它,但它给了我这个错误
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
任何建议???
答案 0 :(得分:3)
你可以在同一台计算机上安装更多的R,所以我建议你下载适当的版本,如果这个包很重要,你可以使用它。
答案 1 :(得分:2)
只是添加NAMESPACE文件确实有帮助。
解压缩包,然后在untarred包中创建一个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:)