lib = C:/Users/xxx/Documents/R/win-library/4.0' is not writable
After way too many hours of frustration I found the culprit:
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
Reason Behind Speed of Fread in Data.Table Package in R
How to Implement a Cleanup Routine in R Shiny
Collect All User Inputs Throughout the Shiny App
Efficiently Computing a Linear Combination of Data.Table Columns
Call by Reference in R (Using Function to Modify an Object)
Finding the Index Inside a Vector Satisfying a Condition
Convert Character Matrix into Numeric Matrix
Standard Deviation in R Seems to Be Returning the Wrong Answer - am I Doing Something Wrong
Exporting Non-S3-Methods with Dots in the Name Using Roxygen2 V4
How to Set the Default Language of Date in R
Split the Title Onto Multiple Lines
Convert a Date Vector into Julian Day in R
Aggregate and Reshape from Long to Wide
Change Values in Multiple Columns of a Dataframe Using a Lookup Table
Programmatically Creating Markdown Tables in R with Knitr
Align Multiple Plots in Ggplot2 When Some Have Legends and Others Don'T