I was trying to install rtools40 using:
writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', con = "~/.Renviron")
but then (after restarting Rsession) this first error message appeared:
Error: package or namespace load failed for ‘stats’ 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.
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found Error 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.
Then, I did:
update.packages(ask=FALSE, checkBuilt=TRUE)
Second error message:
The downloaded sourse packages are in
'C:Usersuser-nameAppDataLocalTempRtmpktiV4dowloaded_packages'
Warinin in install.packages(update[instlib==l, "Package"], l, repos =
repos, : Error in install.packages(update[instlib == l, "Package"], l,
repos = repos, : unable to install packages.
You can appreciate that in this second image it is written that a direction was not writable and is when R asked whether I would have liked to use a personal library and I typed 'YES' but now I have a fatal error.
I tried to install 'stats' package:
library(stats, lib.loc = "C:/Program Files/R/R-4.0.3/library")
And this third error message appeared:
Error: package or namespace load failed for ‘stats’ 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.
Lastly, I have tried to uninstall R and R studio but this problem persist, I have no clue how to change the library location.