I am having difficulty installing packages, specifically ggplot2

#This was what my console looks like. Does anyone have a solution?

install.packages("ggplot2")
Installing package into ‘/Users/coreydolgin/Library/R/3.3/library’
(as ‘lib’ is unspecified)
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.0 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 'https://cran.rstudio.com/src/contrib/isoband_0.2.1.tar.gz'
Content type 'application/x-gzip' length 2293333 bytes (2.2 MB)

downloaded 2.2 MB

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.3.0.tar.gz'
Content type 'application/x-gzip' length 3031461 bytes (2.9 MB)

downloaded 2.9 MB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2019c.1.0/zoneinfo/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 ‘/Users/coreydolgin/Library/R/3.3/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 'zone/tz/2019c.1.0/zoneinfo/America/New_York'
    ERROR: dependency ‘isoband’ is not available for package ‘ggplot2’
  • removing ‘/Users/coreydolgin/Library/R/3.3/library/ggplot2’
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/41/1mmznhzx6p3gcxxk1t2t13g40000gn/T/RtmprcXuMq/downloaded_packages’

If you need to install packages from source, then 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/

1 Like

@andresrcs is correct - but you even only need the Command Line Tools from the Xcode IDE: https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/

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