Ever since I installed rtools, the stat package will not load. This is only a problem with R Studio; I can use the stat package when I use R directly. Here is the error I get:
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Program Files/R/R-3.6.1/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
I have tried reinstalling R and R Studio. I have tried installing an earlier version of R Studio. I have uninstalled rtools. None of this helps. Please help! I miss R Studio!
R version 4.0.0 (2020-04-24) -- "Arbor Day"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
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.0/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
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.0/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
Did you resolve the problem? I am experiencing the same thing and no matter how many times I reinstall it won't work. It seems I have to abandon the entire laptop.
If you install rtools following official website instructions, here is my solution.
Step 1: Unhidden files and folders in Windows setting
Step 2: Delete the file named "./Renviron" which is a hidden file
After this, you can use Rstudio as normal but not rtools. If you want to use rtools, please finish the next few steps.
Step3: Suppose you install Rtools 40 in default setting, namely the installation fold is "C:\rtools40". Executive the following in R or Rstudio (try both) writeLines('PATH="C:\rtools40\usr\bin;${PATH}"', con = "~/.Renviron")
Step4: Now restart R, and verify that make can be found, which should show the path to your Rtools installation.
Thank you for your detailed solution. I will give that a try!! Right now I just reinstalled R and reinstalled RStudio (had to install RStudio in a different directory for it to work, probably because of the hidden files you mentioned), and have not reinstalled Rtools. I was afraid tools will mess up my Rstudio again. I will try your solution. Thank you!
Hi, I followed the solution you gave but I cannot find the"./Renviron" folder, so I proceeded to do the rest. When I do the rest and follow the instructions, " *writeLines('PATH="C:\rtools40\usr\bin;${PATH}"', con = "~/.Renviron")" runs and after ristarting is just as if i did noting the mesage error is still there and Sys.which("make") just returns "". So I do not know what else to do. Ive tried everything.
Step 3 didn't work in R or Rstudio. I get the following error message: Error: '\u' used without hex digits in character string starting "'PATH="C:\rtools40\u"
I modified your instruction a little based on the instruction on the website and it seemed to work (added a couple of ). But the Sys.which did not give me the response you suggested and I cannot install packages. Here is what happens:
writeLines('PATH="C:\rtools40\usr\bin;${PATH}"', con = "~/.Renviron")