Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Car package not found by R (failed to load)

Tags:

r

r-car

I am am trying to load a simple dataset using:

library(car)

but I get the following error:

Error in library("car") : there is no package called 'car'

Does anyone have an idea why this happens and how to solve it?

like image 257
fabiof Avatar asked Jan 09 '15 10:01

fabiof


3 Answers

If you don't currently use an IDE (or even if you do), the following will install the package:

install.packages("car")

Before then running

library("car")

You should heed @Iris's advice and use a RStudio if you don't already to manage just this sort of task.

like image 160
Phil Avatar answered Sep 30 '22 06:09

Phil


You forgot to install the package before you tried to load it.

Do you use a IDE (integrated development environment)? I can strongly recommmand the use of Rstudio as IDE. When you installed Rstudio, you can choose in the toolbar: "Tools" > "Install packages..." Type in "car" and click "install". As soon as the package is installed, you can load the package with library(car)

like image 42
Iris Avatar answered Sep 30 '22 06:09

Iris


I know this post was from several months ago, but I came across it after having the same issue. I followed the instructions here (it's a .doc download).

I typically use R Studio, but was having no luck with this:

install.packages("car") 

I opened the R application (not Studio) and followed the instructions on the .doc. I now have the package. Good luck!

like image 30
travissari Avatar answered Sep 30 '22 04:09

travissari