Error in installation a R package

parvij

Please help me, I cannot install "MASS" package.

> library(MASS)
Error in library(MASS) : there is no package called ‘MASS’

I tried to install MASS package from local:

> utils:::menuInstallLocal()  
package ‘MASS’ successfully unpacked and MD5 sums checked  
Warning: cannot remove prior installation of package ‘MASS’

Even I cannot remove "MASS":

> remove.packages("MASS")  
Removing package from ‘C:/Program Files/R/R-3.0.1/library’  
(as ‘lib’ is unspecified)  
Error in find.package(pkgs, lib) : there is no package called ‘MASS’

Also with this option I couldn't install package:

> options(install.lock=T)  
> utils:::menuInstallLocal()  
package ‘MASS’ successfully unpacked and MD5 sums checked  
Warning: cannot remove prior installation of package ‘MASS’  
Warning: restored ‘MASS’  
Warning message:  
In file.copy(savedcopy, lib, recursive = TRUE) :  
  problem copying C:\Program Files\R\R-3.0.1\library\00LOCK\MASS\libs\x64\MASS.dll to C:\Program Files\R\R-3.0.1\library\MASS\libs\x64\MASS.dll: Permission 

And with install.packages:

> install.packages("C:\\MASS_7.3-35.zip",repos=NULL)
package ‘MASS’ successfully unpacked and MD5 sums checked  
Warning: cannot remove prior installation of package ‘MASS’  
Warning: restored ‘MASS’  
Warning message:  
In file.copy(savedcopy, lib, recursive = TRUE) :  
  problem copying C:\Program Files\R\R-3.0.1\library\00LOCK\MASS\libs\x64\MASS.dll to C:\Program Files\R\R-3.0.1\library\MASS\libs\x64\MASS.dll: Permission 

I should mention I use R with ORE (Oracle R Enterprise).

Tyler Rinker

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

rgeos package installation error on linux [R]

From Dev

R package arules installation error on macos

From Dev

Unknown Error on package installation

From Dev

bsts package installation error

From Dev

mlr package installation error

From Dev

Pip Package Installation Error

From Dev

Emacs installation package error

From Dev

Error with h2oEnsemble package installation for R

From Dev

R package 'spatstat': installation problems

From Dev

R package 'spatstat': installation problems

From Dev

xgboost R package installation fails

From Dev

R not finding package even after package installation

From Dev

R not finding package even after package installation

From Dev

FreeBSD and R mongolite package installation error: missing openssl.pc file

From Dev

R Error During Forecast Package Installation after CUDA-9.1 Upgrade on Ubuntu 17.10

From Dev

R package installation issue for R version 3.1.1

From Dev

Error installing a R package

From Dev

Compilation error of R package

From Dev

Python package installation error - chronic issue

From Dev

Nuget Package Error during Installation of MongoDB driver

From Dev

OTRS .opm package installation fails with error?

From Dev

how to solve ujson package installation error in python

From Dev

Python package installation error - chronic issue

From Dev

Error : Package 'mongodb' has no installation candidate

From Dev

NuGet package installation fails with unspecified error

From Dev

Error - Package 'pulseaudio' has no installation candidate

From Dev

Installation of R-package "BH" not possible

From Dev

Error while retrieving package metadata in installation of nuget package in VS 2015

From Dev

Centos 6.3 R installation error

Related Related

HotTag

Archive