R中的install.packages错误:文件'test_0.1.zip'不是OS X二进制包

时间:2014-04-28 08:26:02

标签: 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 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

对可能出现的问题有什么看法?

enter image description here

以下是每一步输出的详细版本。

> 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.

1 个答案:

答案 0 :(得分:1)

我通过在终端中键入以下命令来修复gnutar的安装(显然这是OSX Maverick的一个问题)。但是,当我使用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