Error downloading car package

Hi, I am getting this error when trying to install the car package. Does anyone know what it means or how I can download this package?

install.packages("car")
also installing the dependency ‘quantreg’

There are binary versions available but the source versions are later:
binary source needs_compilation
quantreg 5.67 5.70 TRUE
car 3.0-9 3.0-10 FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source packages ‘quantreg’, ‘car’

trying URL 'https://cran.rstudio.com/src/contrib/quantreg_5.70.tar.gz'
Content type 'application/x-gzip' length 1002194 bytes (978 KB)

downloaded 978 KB

trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-10.tar.gz'
Content type 'application/x-gzip' length 501293 bytes (489 KB)

downloaded 489 KB

  • installing source package ‘quantreg’ ...
    ** package ‘quantreg’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gfortran -fPIC -Wall -g -O2 -c boot.f -o boot.o
    make: gfortran: No such file or directory
    make: *** [boot.o] Error 1
    ERROR: compilation failed for package ‘quantreg’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/quantreg’
    Warning in install.packages :
    installation of package ‘quantreg’ had non-zero exit status
    ERROR: dependency ‘quantreg’ is not available for package ‘car’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/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/bb/vhmwjmzj49n5bf35_ytmr_5c0000gp/T/RtmpCtyvnu/downloaded_packages’

library(car)
Error in library(car) : there is no package called ‘car’

Thanks.

The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version 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/

Hi Andreas, thanks for the response.

I have tried inputting "no" and I still get errors. I need the package for Levene's test. Is there another way to access this?

I tried to download Xcode, however it says I need IOS version 10.15 and only have IOS 10.13 (which I just updated today). I have an old Xcode version 8.2.1 - will this work do you know? I also saw on another forum to download command line tools - there are many options for this, is there one in particularly that I need?

I'm not a mac user so I can't give you any specific advice but I think if you read the documentation on the link I gave you, you will find which software you need to install for your specific macOS version in order to compile R packages from source.

I downloaded gfortran-6.1.pkg and Command line tools for Xcode but the package is still giving an error. Any other ideas?

I downloaded package data.tables which then allowed me to download car. So all fixed. Thanks

For future reference, most likely the error message you got after installing gfortran and the command line tools, was different than the one you got at the beginning, and for others to been able to keep helping you, you need to post it here.

This topic was automatically closed 21 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.