Library Is Not Writable

lib = C:/Users/xxx/Documents/R/win-library/4.0' is not writable

After way too many hours of frustration I found the culprit:

Sample Image

Turning off real-time protection on Windows Security fixes the issue:

> install.packages("gapminder")
Installing package into ‘C:/Users/mario/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/gapminder_0.3.0.zip'
Content type 'application/zip' length 2031853 bytes (1.9 MB)
downloaded 1.9 MB

package ‘gapminder’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\mario\AppData\Local\Temp\RtmpGi9Jo9\downloaded_packages

That explains why the problem appeared from one day to the next (Windows 10 update) and why it doesn't show on my work laptop (IT-managed updates). Now to figure out how to put R/RStudio on the exclusion list rather than shutting this option off completely.

Problems with package install in R

Check this. Says you need to run R as an administrator. Hope it works!

Solution: Packages under Windows 7, Win8, Win10 need to be installed into a user directory (C:\R\R-3.2.2), or R needs to be started as Administrator (in start menu or Explorer use mouse right-click, then run as administrator).



Related Topics



Leave a reply



Submit