Problem installing the car library

Hi everyone,

I keep running into an issue with the Car library I don't seem to be able to solve and was hoping someone more experienced than myself could point me in the right direction. I'm running RStudio, R version 3.5.1 on a Windows machine.

I am trying to use the function qqplot for diagnostics from the car library but am having trouble getting the car package to work.

I get this when I install the package

> install.packages("car", dependencies = TRUE)
Installing package into ‘C:/Users/kat/OneDrive/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/car_3.0-2.zip'
Content type 'application/zip' length 1483220 bytes (1.4 MB)
downloaded 1.4 MB

package ‘car’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Kat\AppData\Local\Temp\RtmpyUWb6Z\downloaded_packages

But when I go to use the library I get the following

> library(car)
Error: package or namespace load failed for ‘car’ in namespaceExport(ns, exports):
 undefined exports: get_config, set_config, set_config_in

And I cannot for the life of me figure out what the issue is. I have tried wiping R from my computer and reinstalling, same result. I ran update.packages() before I tried reinstalling car to make sure it wasn't upset due to a dependency issue.

I have more than enough space in OneDrive (I haven't managed to figure out how to move the default library when I install R so it ignores OneDrive altogether, Question for another day) so I don't really think my problem lies there. Additionally, packages like ggplot2 are working fine, it's just this specific package I'm having trouble with.

Other possibly relevant info, this is the computer admin account, so it's not a problem of not being allowed to download something. I also checked any windows defender or firewall issue and say nothing.

Any guidance would be appreciated.

Hi @kat! Welcome!

I think the error you're seeing is coming from somewhere deep in car's dependency tree (car depends on several hefty packages that in turn themselves have many dependencies, so there's a lot of room for things to go wrong). The functions that R is failing to find come from the pkgconfig package, which contains utilities for package developers.

So to start off, what happens when you run:

install.packages("pkgconfig", dependencies = TRUE)
2 Likes

Hey thank you for answering, sorry it took me so long to get back to you. This got me on the right track to fixing it, thank you so much.

For anyone else who has the same issue, after I installed the 'pkgconfig' package, I also got warnings about needing to install the package of 'data.table' and 'hms'. Those got the car library to work.

I had previously tried to install car with:

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

But that did not solve my problem. I had to manually install the packages and then install car.
The car package now works correctly for me. Thank you so much again.

1 Like

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