代码改变世界

R安装package报ERROR: a 'NAMESPACE' file is required

2016-05-18 11:09  猎手家园  阅读(1658)  评论(0编辑  收藏  举报

R安装package报错:

[root@Hadoop-NN-01 mysofts]# R CMD INSTALL trimcluster_0.1-1.tar.gz 
* installing to library '/usr/local/lib64/R/library'
WARNING: omitting pointless dependence on 'R' without a version requirement
* installing *source* package 'trimcluster' ...
ERROR: a 'NAMESPACE' file is required
* removing '/usr/local/lib64/R/library/trimcluster'

解决方案:

#解压
tar -xzf trimcluster_0.1-1.tar.gz

#写入NameSpace
cd trimcluster
echo 'exportPattern( "." )' > NAMESPACE
cd ..

#打包
tar -zcf trimcluster.tar.gz trimcluster

#再次安装
R CMD INSTALL trimcluster.tar.gz

安装成功!