Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to update R packages in default library on Windows 7

Tags:

r

windows-7

I'm trying to update packages on RGui (64-bit) using update.packages but I'm getting the following message:

Warning in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :   'lib = "C:/PROGRA~1/R/R-212~1.1/library"' is not writable Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :    unable to install packages 

I've looked at the library folder in Explorer and it has read only set, so I removed it. However, it reappears when I check the properties again immediately after doing this. Installing new packages is unaffected since they have a separate folder in my user profile.

Is there a trick to getting this to work?

like image 669
James Avatar asked Feb 20 '11 20:02

James


People also ask

How do I change the default package in R library?

To set environment variable R_LIBS_USER in Windows, go to the Control Panel (System Properties -> Advanced system properties -> Environment Variables -> User Variables) to a desired value (the path to your library folder), e.g.

How do I manually install an R package?

Go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files", then find the zip file with arm from wherever you just saved it. Do the same thing to install each of the other packages you want to install.


1 Answers

It happens the same to me, and after coding hours and hours in "R" of Gui Project, i got bored because it is much easier to read a code when the interface uses colours for a certain type of words (commands). Well, i decided to install RStudio, but soon i was faced with package installation problems. It seems that happens in Windows 7. The way that I used to solve this problem with RSutido was:

  1. C:\Program Files\R - and this is the folder that contains "R" and not RStudio folder!
  2. Right click for properties.
  3. Security.
  4. In "Group or user names" select your name
  5. click "Edit"
  6. select "Full control"
  7. Apply and click OK

After this steps you should be ok to install all the packages :-)

like image 69
Johnaz Grynn Avatar answered Sep 22 '22 14:09

Johnaz Grynn