My R and Rstudio - were working fine, but recently, when I install any package in Rstudio and add library(package) I am getting following error :
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-3.6.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-3.6.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
If tried to install package seperately in R , outside Rstudio, I am able to run it. But not able to do that in Rstudio. I tried installing Rtools, even reinstalled and tried Rstudio, but now I am getting same error message in Rstudio. - Not able to find the issue
Can anyone help me with this?
Sys.getenv("PATH")
```[1] "\\usr\\bin;"
This is the result, which is not the path of R.
I tried changing the system variable by adding the correct R path to the environment as mentioned in the solved links .
but still, am getting same. Sys.getenv ("PATH")- result
how do I change this "PATH" directory?
Thanks, I found the solution, while installing Rtools40 - the "PATH" issue got generated. and when I tried uninstalling and reinstalling the lesser version - the PATH location got changed to usr\bin.
I now tried changing the PATH location by giving the following command;
writeLines('PATH="C:\Program Files\R\R-3.6.3\bin\x64"', con = "~/.Renviron")
It worked fine. I am not getting the "stats.dll not found" error anymore when I install packages or load any library.