我使用的是Rstudio-version 0.99.902和R-version 3.3.1(2016-06-21)。
我写了一个我想提交给CRAN的软件包。当我运行devtools::check()
函数(包含--as-cran)时,我成功传递所有测试, NO 错误/警告/注释。
虽然当我在终端上运行相同的程序(ubuntu 15.10)时,它会给我错误和警告。
正在运行R CMD build
-
R CMD build mypackage
//home/akilesh/anaconda2/bin/R: 12: [: Linux: unexpected operator
/home/akilesh/anaconda2/lib/R/bin/R: 12: [: Linux: unexpected operator
* checking for file ‘mypackage/DESCRIPTION’ ... OK
* preparing ‘mypackage’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘mypackage_0.1.0.tar.gz’
正在运行R CMD check
-
R CMD check mypackages_0.1.0.tar.gz
/home/akilesh/anaconda2/bin/R: 12: [: Linux: unexpected operator
/home/akilesh/anaconda2/lib/R/bin/R: 12: [: Linux: unexpected operator
* using log directory '/home/akilesh/Desktop/CRAN/final/mypackage.Rcheck'
* using R version 3.3.1 (2016-06-21)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘mypackage/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘mypackage’ version ‘0.1.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘mypackage’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... ERROR
/home/akilesh/anaconda2/lib/R/bin/R: 12: [: Linux: unexpected operator
* DONE
Status: 1 ERROR
See
‘/home/akilesh/Desktop/CRAN/final/mypackage.Rcheck/00check.log’
for details.
这是我的DESCRIPTION
文件
Package: mypackage
Type: Package
Title: package title
Version: 0.1.0
Author: Akilesh [aut,cr]
Maintainer: Akilesh <myemailid@gmail.com>
Description: My package description.
License: GPL-2
LazyData: FALSE
Imports:
rvest,dplyr,httr,stringr,jsonlite,glue,xml2
Suggests:
knitr
RoxygenNote: 6.0.1
Encoding: UTF-8
我无法理解为什么会这样。我是否仍然可以将我的包提交给CRAN,因为它在Rstudio devtools::check()
上运行时通过了测试?虽然它在Rstudio上运行时通过了所有测试,为什么它不通过终端上的测试?它与安装Conda
有关吗?
/home/akilesh/anaconda2/lib/R/bin/R: 12: [: Linux: unexpected operator
错误有什么意义?
UPDATE
:添加了R的最低版本号以及所有Imports。徒劳无功。