Unable to update R packages in default library on Windows 7

James picture James · Feb 20, 2011 · Viewed 72.4k times · Source

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?

Answer

Johnaz Grynn picture Johnaz Grynn · Apr 19, 2014

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 :-)