Installing package - cannot open file - permission denied Installing package - cannot open file - permission denied r r

Installing package - cannot open file - permission denied


I had the same issue. Tried doing the following and worked for me:

  1. Run the RStudio as administrator
  2. Under the Packages tab, click Install and change Install to Library option to C:/Program...../R/../library and select the desired package to install.

enter image description here

Hope it works.


I had the same issue. Try running R or R studio as administrator. That resolved it for me.


I had the same problem. R gave me an error message whenever I tried to install a new, or update an existing package. I don't remember what the message said exactly, but it was saying "Cannot open file (...) access denied". I tried all the following. Not sure what exactly fixed the problem, but now I can update and/or install new packages:

  1. Open R/RStudio as administrator;
  2. Change the R library folder (where packages are installed) security settings, and grant full access to my computer user account. Link1, link2;
  3. (I think this was what fixed the problem) Follow instructions on this link. It prompted me to install another package, "devtools". Then it worked.