I've had RStudio for months now, and I've never had a problem installing packages. However, I'm no longer to install packages. And packages that I do have, like ggplot2, won't work. When I try to install, for example, glmnet, I get the following error
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/User/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘iterators’, ‘foreach’, ‘shape’
# ...
package ‘glmnet’ successfully unpacked and MD5 sums checked
And when I try to load it:
library(glmnet)
#
Loading required package: Matrix
Error: package or namespace load failed for ‘Matrix’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.0.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
Error: package ‘Matrix’ could not be loaded
But the same problem happens when I try to install Matrix. I don't understand why this has happened. I've uninstalled R and Rstudio multiple times, but the problem persists. I installed Rtools and put it in the directory they want, but still nothing can be installed or loaded.
Any idea what might be happening? Not two months ago, I was able to install ggplot2 and I've been using it ever since (barring the past few days).
C:/Program Files/R/R-4.0.3/library/stats/libs/x64/stats.dll? What version of windows are you running? Are you on a 32 or 64 bit machine? Was this the exact same error message you were getting before you tried reinstalling R? - MrFlicklib=path where they should install to and R looks for packages in your.libPaths(). But the unable to load library message on a core DLL is odd. Do you have some over aggressive anti virus software running? Have you tried restarting your computer? - MrFlickc:/R/or perhapsc:/ProgramData/R/(notProgram Files). - r2evans