There are many people across our organization having the same issue. It does relate to the temporary file being locked by our enterprise anti-virus application when RStudio tries to move the package into the user's package directory. Changing the wait Sys.sleep time allows the anti-virus to do its scan and release the file for moving. This solution has worked for everyone who experiences this issue. How can we log this for developers to fix? I certainly do not expect to make RStudio slower by globally upping the Sys.sleep time in the application but the current work-around only works for the current session a user is in. Every time the RStudio app is started or a new session is spun up, the user has to employ this work-around. I would hope there would be a way we can permanently make this update to the Sys.sleep time through modifying a configuration file rather then taking this manual step every time.
Since this issue is being experienced by many Windows users across multiple organizations, is there any appetite to make this update/change?
I'm not totally sure where in the stack the install.packages()Sys.sleep() time comes from — it's not dplyr-specific. So, this might be an IDE feature request.
If I'm following this correctly, it sounds like @bblake73's organization has been struggling with the phenomenon where install.packages() can fail on Windows because antivirus software interferes with the step where an installed package binary is moved from a temporary directory to its final location. And the current workaround (as described in the answers to this StackOverflow question) is to overwrite a hard-coded Sys.sleep() time, which of course is inconvenient, since this patch has to be applied anew each session. Have I got that right?
The workaround involving patching Sys.sleep() will not work with R >= 3.5, since the Sys.sleep() call was replaced with a different approach to solving the antivirus interference problem
Hopefully the newer approach will work better! Are you able to test out updating to a newer version of R? I'd be curious to know whether you see any improvement in these package installation problems.
This is all part of core R functionality, so I'm afraid it's not something that the RStudio IDE can directly affect. Decisions about how to make install.packages() handle antivirus interference better are up to the R Core Development Team.
(Disclaimer: from this StackOverflow answer which has no votes yet, and which I can't test myself! If it works for you, please go upvote the original contributor on SO )
If you can get some version of the above working on your systems, you could at least put it in an .RProfile file so it gets run automatically for new sessions.