Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in untar( ) while using R

Tags:

r

tar

I am new to the R programming language and am having basic issues with it. I want to untar a file, but it has not been able to work for me.

Here is the code that I enter:

untar("CD_data.tar", exdir="data")

It then returns the following error message:

/bin/sh: /usr/bin/gnutar: No such file or directory

Warning message:

In untar("CD_data.tar", exdir = "data") :
  ‘/usr/bin/gnutar -xf 'CD_data.tar' -C 'data'’ returned error code 127

Please help! Thanks!

like image 291
user3194786 Avatar asked Jan 14 '14 16:01

user3194786


1 Answers

R on OS X 10.9 (Mavericks) seems to set a wrong TAR environment variable.

You can fix this by adding the following to your .Rprofile (or executing it manually):

Sys.setenv(TAR = '/usr/bin/tar')

Alternatively, you can provide the tar path as an argument when calling untar.

like image 60
Konrad Rudolph Avatar answered Sep 22 '22 03:09

Konrad Rudolph