Windows 7, update.packages problem: unable to move temporary installation?
I found that the problem indeed is the antivirus "real time file system protection". I do the following to fix the problem:
trace(utils:::unpackPkgZip, edit=TRUE)
I edit line 140 (line 142 in R 3.4.4):
Sys.sleep(0.5)
to:
Sys.sleep(2)
I seems like the antivirus stalls the creation of the package tmp dir. After changing it to 2 seconds the error is gone.
EDIT: to do this programmatically execute
trace(utils:::unpackPkgZip, quote(Sys.sleep(2)), at = which(grepl("Sys.sleep", body(utils:::unpackPkgZip), fixed = TRUE)))
(credits @DavidArenburg)
Cant install a package in R
There are a couple of potential solutions at this link: Windows 7, update.packages problem: "unable to move temporary installation"?
Could be an antivirus problem, or possibly lacking administrator privileges. The link recommends installing R in a different folder, or downloading the zip file for the package and installing it by hand.
Unable to update R packages in default library on Windows 7
Usually you need administrator rights to change things in program files. Try running RGui as administrator.
Related Topics
Select Equivalent Rows [A-B & B-A]
Workflow For Statistical Analysis and Report Writing
Select First and Last Row from Grouped Data
Method to Extract Stat_Smooth Line Fit
What Is the Width Argument in Position_Dodge
Merging Two Data Frames Using Fuzzy/Approximate String Matching in R
How to Replace Na With Mean by Group/Subset
How to Tell What Is in One Vector and Not Another
Incomplete Final Line' Warning When Trying to Read a .Csv File into R
How to Use Grep()/Gsub() to Find Exact Match
Selecting Only Numeric Columns from a Data Frame
Put Stars on Ggplot Barplots and Boxplots - to Indicate the Level of Significance (P-Value)
How to Match Fuzzy Match Strings from Two Datasets
Plotting Contours on an Irregular Grid
How to Set Up Conda-Installed R For Use With Rstudio
Getting Warning: " 'Newdata' Had 1 Row But Variables Found Have 32 Rows" on Predict.Lm