Just to get the basic diagnostics and system info out of the way, the following info is usually helpful:
RStudio Edition: (Desktop or Server)
The output of
However, googling around a bit for this error message related to R upgrades strongly suggests that you might not have write access to anything in C:\Program Files. If you want to install to the system library, you must run R as administrator.
From R's FAQ Docs, 2.24 Does R run under Windows Vista/7/8/Server 2008?
If you use the default Administrator account (without ‘admin approval mode’ being turned on) and ins tall/update packages (in the system area or elsewhere), no issues are known.
If you use an account in the local Administrators group in ‘admin approval mode’ (which is the intended norm under these OSes), installation will make use of ‘over-the-shoulder’ credentials. You will run into problems if you try installing (including updating) packages in the main R library. (It would be nice if at that point R could use over-the-shoulder credentials, but they apply to processes as a whole. Vista and later disallow creating .dll files in the system area without credentials.) There are several ways around this.
- Run R with Administrator privileges in sessions where you want to install packages. (Do so by right-clicking on the R shortcut and selecting ’Run as Administrator’.)