Error in install.package - "Error in install.packages : unable to open file '...': Permission denied."

I'm installing R desktop, but I can't install a library, the error is:
"Error in install.packages : unable to open file 'D:/Users/DianaR/Documents/R/win-library/4.1/file26c071692b9d/colorspace/cvdemulator/www/images/descimage.png': Permission denied."
How can this be resolved?

The error message is telling you that you don't have permission to open that particular file, which R is trying to access as your install this package.

  • I think the most common solution to this is to be sure you're an administrator, and then install or upgrade your packages, with install.package("PACKAGE_NAME") again.
  • Some folks report that software like antivirus may block R from accessing these files. If that's possible, tell your antivirus to let R and RStudio have access to the file system

Some more discussion and approaches to solve in on different systems here,

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.