R:file‘;中的install.packages出错;测试0.1.zip和x2019;不是OS X二进制软件包

R:file‘;中的install.packages出错;测试0.1.zip和x2019;不是OS X二进制软件包,r,binary,package,cran,devtools,R,Binary,Package,Cran,Devtools,我试图按照手册为R创建软件包,但我被困在install.package步骤中: require(devtools) build("/Users/mona/test") build("/Users/mona/test", binary=TRUE) check("/Users/mona/test", cran=FALSE) > install.packages("test_0.1.zip", repos=NULL) tar: Error opening archive: Failed to o

我试图按照手册为R创建软件包,但我被困在install.package步骤中:

require(devtools)
build("/Users/mona/test")
build("/Users/mona/test", binary=TRUE)
check("/Users/mona/test", cran=FALSE)
> install.packages("test_0.1.zip", repos=NULL)
tar: Error opening archive: Failed to open 'test_0.1.zip'
Warning in install.packages :
'tar' returned non-zero exit code 1
Error in install.packages : file ‘test_0.1.zip’ is not an OS X binary package


> install.packages("test_0.1.tar.gz", repos=NULL)
tar: Error opening archive: Failed to open 'test_0.1.tar.gz'
Warning in install.packages :
'tar' returned non-zero exit code 1
Error in install.packages : file ‘test_0.1.tar.gz’ is not an OS X binary package
有什么想法可能是错误的吗

下面是每个步骤的详细输出版本

> require(devtools)
> build("/Users/mona/test")
'/Library/Frameworks/R.framework/Resources/bin/R'  \
  --vanilla CMD build '/Users/mona/test'  \
  --no-manual --no-resave-data 

* checking for file '/Users/mona/test/DESCRIPTION' ... OK
* preparing 'test':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'test_0.1.tar.gz'

[1] "/Users/mona/test_0.1.tar.gz"
> build("/Users/mona/test", binary=TRUE)
'/Library/Frameworks/R.framework/Resources/bin/R'  \
  --vanilla CMD INSTALL  \
  '/Users/mona/test' --build 

* installing to library '/private/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T/RtmpXfaW60'
* installing *source* package 'test' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
sh: /usr/bin/gnutar: No such file or directory
gzip: can't stat: /Users/mona/test_0.1_R_x86_64-apple-darwin10.8.0.tar (/Users/mona/test_0.1_R_x86_64-apple-darwin10.8.0.tar): No such file or directory
Warning in file.rename(file.path(startdir, filename), file.path(startdir,  :
  cannot rename file '/Users/mona/test_0.1_R_x86_64-apple-darwin10.8.0.tar.gz' to '/Users/mona/test_0.1.tgz', reason 'No such file or directory'
packaged installation of 'test' as 'test_0.1.tgz'
* DONE (test)
[1] "/Users/mona/test_0.1.tgz"
> check("/Users/mona/test", cran=FALSE)
Updating test documentation
Loading test
'/Library/Frameworks/R.framework/Resources/bin/R'  \
  --vanilla CMD build '/Users/mona/test'  \
  --no-manual --no-resave-data 

* checking for file '/Users/mona/test/DESCRIPTION' ... OK
* preparing 'test':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'test_0.1.tar.gz'

'/Library/Frameworks/R.framework/Resources/bin/R'  \
  --vanilla CMD check  \
  '/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T//RtmpXfaW60/test_0.1.tar.gz'  \
  --timings 

* using log directory '/private/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T/RtmpXfaW60/test.Rcheck'
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-apple-darwin10.8.0 (64-bit)
* using session charset: ASCII
* checking for file 'test/DESCRIPTION' ... OK
* this is package 'test' version '0.1'
* 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 'test' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
  What license is it under?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking examples ... NONE
* checking PDF version of manual ... OK
WARNING: There was 1 warning.
See
  '/private/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T/RtmpXfaW60/test.Rcheck/00check.log'
for details.

我通过在终端中键入以下命令(显然这是OSX Maverick的问题),以这种方式修复了gnutar的安装。但是,当我使用
install.package
安装软件包时,我收到了相同的问题:

sudo su -
cd /usr/bin
ln -s tar gnutar
curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.2.1.tar.bz2
tar xf MacPorts-2.2.1.tar.bz2
cd MacPorts-2.2.1/
./configure
make
sudo make install
sudo port -v selfupdate

我没有使用Mac,但Mac软件包不是“tgz”软件包吗<代码>安装程序包(“test_0.1.tgz”,repos=NULL)?目录(“.”,pattern=“test_1.0.*)告诉您什么?创建了什么文件?你看到tar.gz文件了吗?
>dir(“.”,pattern=“test_1.0.*)字符(0)
我不知道为什么不创建它。支票刚刚给了我一个警告!没有错误@sgibb我已经更新了我的问题,在每个步骤都有详细的输出。你能看一下吗?我的OSX是特立独行的
sh:/usr/bin/gnutar:没有这样的文件或目录gzip:无法统计:/Users/mona/test_0.1_R_x86_64-apple-darwin10.8.0.tar(/Users/mona/test_0.1_R_x86_64-apple-darwin10.8.0.tar):文件中没有这样的文件或目录警告。重命名(file.path(startdir,filename),file.path(startdir,:无法将文件'/Users/mona/test_0.1_R_x86_64-apple-darwin10.8.0.tar.gz'重命名为'/Users/mona/test_0.1.tgz',原因是'test'的打包安装“没有这样的文件或目录”为'test_0.1.tgz'
我不知道/使用Mac OSX,但显然您没有安装
gnutar