Error in Installation a R Package

Error in installation a R package

There could be a few things happening here. Start by first figuring out your library location:

Sys.getenv("R_LIBS_USER")

or

.libPaths()

We already know yours from the info you gave: C:\Program Files\R\R-3.0.1\library

I believe you have a file in there called: 00LOCK. From ?install.packages:

Note that it is possible for the package installation to fail so badly that the lock directory is not removed: this inhibits any further installs to the library directory (or for --pkglock, of the package) until the lock directory is removed manually.

You need to delete that file. If you had the pacman package installed you could have simply used p_unlock() and the 00LOCK file is removed. You can't install pacman now until the 00LOCK file is removed.

To install pacman use:

install.packages("pacman")

There may be a second issue. This is where you somehow corrupted MASS. This can occur, in my experience, if you try to update a package while it is in use in another R session. I'm sure there's other ways to cause this as well. To solve this problem try:

  1. Close out of all R sessions (use task manager to ensure you're truly R session free) Ctrl + Alt + Delete
  2. Go to your library location Sys.getenv("R_LIBS_USER"). In your case this is: C:\Program Files\R\R-3.0.1\library
  3. Manually delete the MASS package
  4. Fire up a vanilla session of R
  5. Install MASS via install.packages("MASS")

If any of this works please let me know what worked.

R: make not found when installing a R-package from local tar.gz

what do you need is to update the Rtool, here is the link I had the same issue before once you update it will work.

R packages failed to install: x86_64-apple-darwin13.4.0-ar: No such file or directory - What is ar?

I already solved this problem. I got this problem when using RStudio inside Anaconda. Later I installed R 3.4.3 and RStudio outside Anaconda and everything went smoothly. It might have been some problem with the Anaconda RStudio.

R Install.packages fails with object not found error

This sounds like something is wrong with the .Rprofile file. There can be more than one such file. At the beginning of an R session, R first searches for such a file in the working directory, then in the home directory.

You may also want to check if the environment variable R_PROFILE_USER is set (In an R shell, this can be checked with Sys.getenv("R_PROFILE_USER")). If yes, look at the .Rprofile file in that directory to see if there is any suspicious entry.

If all fails, make a copy of the .Rprofile file in your home directory and (if applicable) in your working directory with a different name. Then delete the file and try the installation again. If this succeeds you can afterwards restore the old .Rprofile file(s) by using the copy/copies that you made before.



Related Topics



Leave a reply



Submit