Installed package e1071, R says the installed pakage is not valid after using library command

package-installation

#1

I am trying to do a confusion matrix in R.
For doing so, I installed the package caret and package e1071. Both packages were successfully installed.
Then using library(caret), which works perfectly fine.
Also using library(e1071) but R gives me the error:

Error e1071: e1071 is not a valid installed package.

What I am doing wrong here?
I already quit and restarted R, but still the same error.


#2

Have you tried reinstalling e1071? Sometimes an installation can get messed up for reasons unknown, so it's worth a try.

install.packages("e1071")

Do you get any warnings or errors after installation?


#3

Hello mara,
why did that work? Thanks! :smiley:

I am always installing to a different location (where I work from) and it didn't work like this....
install.packages("e1071", lib="O:/AQ-5/51_AQ-51/13_AQ-513/99_alt_AQ-630/34_Projekt_Mustererkennung/80_Studienabschlussarbeiten/20_Anne/R packages")

But your solution gave no errors or warnings...weird


#4

Installing without your custom library location will have installed the package to wherever your default library is, rather than re-installing to your custom library. To see all the places R is looking for packages, run:

.libPaths()

It sounds like maybe you are setting this custom library location so that you can access that library from another computer, as well? If so, then since installing the package into your default library will not have fixed anything in the custom library, you may have the same problem crop up on the other computer. To reinstall to your custom library, you’ll have to run install.packages() again the way you normally do, specifying the library location. You’ll want to pay close attention to the console messages to see if the package does in fact install.

If you are consistently setting a custom library location, you might want to make it your default library using one of the R environment variables. This thread has some useful discussion about that:


#5

@jcblum Thank you for your answer! Before working with R, I always execute these commands:

myPaths <- .libPaths()
myPaths <- c(myPaths, 'O:/AQ-5/51_AQ-51/13_AQ-513/99_alt_AQ-630/34_Projekt_Mustererkennung/80_Studienabschlussarbeiten/20_Anne/R packages')
.libPaths(myPaths)

I have to change my directory, because the default setting doesn't have enough place for all my packages....When I want to install a package, I go to the header "Tools" -> "Install Packages" and choose my package. The library is my desired location.....