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

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:

1 Like