I'm unable to install the packages zoo and tidyverse on Rstudio. This is the error message that I've received:
Warning in install.packages :
error in running command
Warning in install.packages :
'tar' returned non-zero exit code 127
sh: tar: command not found
Error in install.packages : file ‘/var/folders/nw/ggs20txx4sxbhjfhrlg91nfr0000gn/T//RtmpItObUX/downloaded_packages/fastmap_1.1.1.tgz’ is not a macOS binary package
I have tried uninstalling and installing R and RStudio again as suggested from other previous questions I've seen, even older versions as well - R 4.2.3 and R 3.6.3. I have currently re-installed the latest compatible version for my laptop - R 4.3.1 (the one I initially started with)
For context, my laptop is a Macbook Pro mid-2014 running on macOS Big Sur 11.7.8. Any help wit h this error would be much appreciated. Also, if it's an issue with how old my laptop is, please let me know. Thanks!
This indicates that the $PATH that the RStudio program is using doesn't include /usr/bin, which is where the tar program is to be found. You can confirm this with
Sys.which("tar")
Using the system Terminal.app or iterm.App, try
which tar
and if the correct path, /usr/bin/tar is returned you should be able to open an R session in the terminal or in the separate R.app installed with R to do the install.packages().
Thank you! We might be getting somewhere now. Unfortunately, grep command cannot be found.
(base) Beas-MacBook-Pro-2:~ Bea$ ls -l /usr/bin | grep which
-bash: grep: command not found
(base) Beas-MacBook-Pro-2:~ Bea$ ls -l /usr/bin | grep tar
-bash: grep: command not found
Anaconda might be to blame. So, take a deep breath and we'll edit your $PATH from the terminal, using the nano editor. The commands of the bottom of its screen, such as ^X mean using the control key and the letter in combination.