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:
- Close out of all R sessions (use task manager to ensure you're truly R session free) Ctrl + Alt + Delete
- Go to your library location
Sys.getenv("R_LIBS_USER")
. In your case this is: C:\Program Files\R\R-3.0.1\library - Manually delete the
MASS
package - Fire up a vanilla session of R
- Install
MASS
viainstall.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
Passing Several Arguments to Fun of Lapply (And Others *Apply)
How to Convert Data Frame to Spatial Coordinates
How to Pass Dynamic Column Names in Dplyr into Custom Function
Rstudio Shiny Error: There Is No Package Called "Shinydashboard"
Split the Title Onto Multiple Lines
Removing One Tablegrob When Applied to a Box Plot with a Facet_Wrap
Find Neighbouring Elements of a Matrix in R
R: How to Split a Data Frame into Training, Validation, and Test Sets
Pattern Matching Using a Wildcard
R Ggplot2: Labelling a Horizontal Line on the Y Axis with a Numeric Value
Sparse Matrix to a Data Frame in R
Assign Value to Group Based on Condition in Column