Question

I am trying to follow a manual for creating packages for R but I am stuck in the install.package step:

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

Any thoughts on what might be wrong?

enter image description here

Here's the detailed version of output at each step.

> 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.
Was it helpful?

Solution

I fixed installation of gnutar this way by typing the following commands in the terminal (apparently it's a problem with OSX Maverick). However yet I receive the same problem when I install the package using 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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top