Package "car" does not install on Mac

While installing the "car" package, I faced an error saying "Warning in install.packages :
installation of package ‘car’ had non-zero exit status"
The package didn't install at all, carData is installed

ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RcppEigen.so] Error 1
ERROR: compilation failed for package ‘RcppEigen’

  • removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RcppEigen’
    Warning in install.packages :
    installation of package ‘RcppEigen’ had non-zero exit status
  • installing source package ‘quantreg’ ...
    ** Paket ‘quantreg’ erfolgreich entpackt und MD5 Summen überprüft
    ** libs
    gfortran-4.8 -fPIC -g -O2 -c akj.f -o akj.o
    make: gfortran-4.8: No such file or directory
    make: *** [akj.o] Error 1
    ERROR: compilation failed for package ‘quantreg’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/quantreg’
    Warning in install.packages :
    installation of package ‘quantreg’ had non-zero exit status
    ERROR: dependency ‘RcppEigen’ is not available for package ‘lme4’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/lme4’
    Warning in install.packages :
    installation of package ‘lme4’ had non-zero exit status
    ERROR: dependencies ‘quantreg’, ‘lme4’ are not available for package ‘car’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/car’
    Warning in install.packages :
    installation of package ‘car’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/04/k1765w8j32555jk30wbl_h7h0000gn/T/RtmpCgXLaR/downloaded_packages’

library(car)
Fehler in library(car) : es gibt kein Paket namens ‘car’

Thanks for the help!

Hi @Luisa,

From looking at the error message, it seems your problem is upstream, as you cannot install the dependencies (the packages that car needs in order to be installed). This starts with RcppEigen which cannot be installed because you don't have the libraries necessary to build it – in this case, -lgfortran.

The post below should help you get that piece sorted:
https://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks--lgfortran-and--lquadmath-error/#after-r-3-4-0

For future reference, unless your problem is with the IDE itself (learn more about the difference between R and RStudio in the FAQ, below), it's best to file it in a category other than RStudio IDE! :slightly_smiling_face: