R, car package unable to load

Tamara Sternlieb picture Tamara Sternlieb · Aug 10, 2015 · Viewed 17.4k times · Source

I'm new with R, and I'm having some trouble loading the car library. I use Windows 8.1 (64 bit) and i'm working in 32 bit R environment. I downloaded the library just fine, but when i try to load the car library using library(car) the message i get is:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘quantreg’
Error: package or namespace load failed for ‘car’

This message came up asking for several other libraries besides quantreg. I downloaded some of those other libraries in the hope that it would be enough to run car, but it doesn't stop asking for more libraries.

Has anyone had the same issue? This also happened to some people I know, using different operating systems, mostly Windows, but also Linux.

Answer

Michael Kirchner picture Michael Kirchner · Aug 10, 2015

It seems that you did not install the dependencies automatically when you installed car. I'm assuming that you tried installing with Rstudio, which does not automatically install dependencies.

This SO post and this one should help you to install them automatically.

Try reinstalling with the command install.packages("car",dependencies=TRUE).

Additionally, in the future you can check the CRAN page to see the depends, imports, suggests, etc.