Installing ggplot will not install because of non-zero exit status

Trying to install ggplot2 in R Studio. Have updated to the latest version, uninstalled/reinstalled, as well as tried to to install others like devtools, tidyverse, broom, but they are all giving me messages after like,
Warning in install.packages :
** installation of package ‘vdiffr’ had non-zero exit status**
The downloaded source packages are in
** ‘/private/var/folders/qt/hkz_ngxs4qxg19nmzrwyxqxc0000gn/T/RtmpQQVvJv/downloaded_packages’**

I have attempted saying type = "source" or dependencies= TRUE in install but that also doesn't work. Would love any advice or help.

Con you give us the actual install.packages command(s) used?

I do not see why you should be getting a

 Warning in install.packages : 
     installation of package 'sf' had non-zero exit status

if you are installing ggplot2.
Also please copy and paste the actual text. Screenshots range from annoying to useless when troubleshooting.

install.packages("ggplot2", dependencies=TRUE)

install.packages(c("ggplot2", "lmtest"))

install.packages("ggplot2")

I have been able to get Rcpp, plyr, and dplyr installed, but cannot get ggplot2 or devtools to download. The message from R is:

Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/qt/hkz_ngxs4qxg19nmzrwyxqxc0000gn/T/RtmpxL3HUy/downloaded_packages’

Ouch!

Would you start a new session with nothing loaded and do:

install.packages("ggplot2")

If it bombs again please paste the output here.

Also, what OS ?

For good luck can you also give us the output of:

 sessionInfo()

Thank you so much for your support and help!

install.packages("ggplot2")
also installing the dependency ‘isoband’


  There is a binary version available but the source version is later:
        binary source needs_compilation
ggplot2  2.2.1  3.3.5             FALSE

Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘isoband’
Do you want to attempt to install these from sources?
y/n: y
installing the source packages ‘isoband’, ‘ggplot2’

trying URL *[had to take out because I'm a new user]*
Content type 'application/x-gzip' length 1671911 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 
Content type 'application/x-gzip' length 3063309 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'default/America/New_York'
* installing *source* package ‘isoband’ ...
** package ‘isoband’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘isoband’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/isoband’
Warning in install.packages :
  installation of package ‘isoband’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'default/America/New_York'
ERROR: dependency ‘isoband’ is not available for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/qt/hkz_ngxs4qxg19nmzrwyxqxc0000gn/T/RtmpxL3HUy/downloaded_packages’



sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS  10.15.7

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] htmltools_0.5.1.1 tools_3.3.3       yaml_2.2.1        rmarkdown_2.9     knitr_1.33       
[6] xfun_0.24         digest_0.6.13     rlang_0.4.11      evaluate_0.14

Last time I used a Mac was at least 15 years ago so I may not be much help

However a quick search on

brings up

which seems to suggest a need update or addition to the OS. You should check with an Apple expert on this. I am totally Ubuntu Linux.

You might want to try try installing ‘isoband’ before ggplot2. This sometimes works

Alternatively can you invoke R from the the terminal or at desktop without using RStudio? The Apple terminal not the one in RStudio.

If so you could try installing from there. Sometimes one can install directly in R when one cannot using RStudio.

In Ubuntu I would also try a direct system's level installation using something like

sudo apt-get update -y
sudo apt-get install -y r-cran-ggplot2

This is a brute force and crowbar approach but works. Not sure if it works with a Mac.

Good luck

You are using a very old R version so you are forced to compile packages from source, for compiling packages in macOS you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

Although, I would strongly recommend updating your R version to the latest one 4.1.0

This clearly shows why we need a Mac expert. I may have wasted a lot of KathBerry's time.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.