Error in untar( ) while using R

r, tar

Solution

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

Problem

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!

Original source