0

I've first updated R (from 3.6.3 to 4.0) and afterwards RStudio (from 1.2.5033 to the most recent 1.2.5042) on Windows 10. Because I kept receiving the error messages below, I downgraded to R 3.6.3 and Rstudio 1.1.463. However, the errors persist. When opening RStudio I receive the following:

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:....

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:...

stats.dll is in the above mentioned location. Interestingly, I can use functions from the stats package in R.exe suggesting that RStudio causes the errors. Similarly, I can't print a sessionInfo():

Error in La_library() : LAPACK routines cannot be loaded
In addition: Warning message:
In La_library() :
  unable to load shared object 'C:/PROGRA~1/R/R-36~1.3/modules/x64/lapack.dll':
  LoadLibrary failure:...

...even though lapack.dll is in the correct place.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • R 4.0 has some new features and deprecated some features in this version. one of them is related to stats. You can refer below link for more details: https://cran.r-project.org/doc/manuals/r-devel/NEWS.html – rj-nirbhay May 04 '20 at 09:24
  • This only says that some functions are defunct, but does not speak to my problem or am I missing something? – Flowsen_95 May 04 '20 at 09:39

1 Answers1

0

It looks as there is confusion between folders of the old (3.6.3) and the new (4.0) version of R, see also this answer.

Suggestion: uninstall both versions of R and install R 4.0 from scratch into a new folder.

tpetzoldt
  • 5,338
  • 2
  • 12
  • 29
  • The error persists. To me it is really confusing that these errors do not occur (and I can use functions from the stats package which I cannot use in Rstudio at the moment) in the Rgui. – Flowsen_95 May 04 '20 at 12:08
  • Do I understand it correctly: It works with RGui, but not with RStudio? Have you already checked the R version in RStudio - Tools - Global Options - General? – tpetzoldt May 04 '20 at 12:23
  • You understood correctly. I was finally able to fix it: I had a mistake in the "PATH" variable of the environment. – Flowsen_95 May 04 '20 at 12:51
  • Ok, sounds plausible. Thanks for the feedback. – tpetzoldt May 04 '20 at 13:07