-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In R-4.2.0 on windows, package 'stats' in options("defaultPackages") was not found. #151
Comments
Thanks for reporting @nhirschey! I'm seeing the same thing and will investigate a solution. |
Just some placeholder notes/updates - Going off some other/older posts, it seems like I need to go back to why, even if I explicitly set the folder where those dependency DLLs are found, it's failing to load. There's probably something in the basics of how DLLs are loaded that I'm just forgetting. |
More placeholder notes (sorry) - Thanks to @nmunozgarcia for noticing the connection in #152. It seems similar - setting PATH explicitly doesn't seem to fix the issue, which is odd because it should. But that's similar to the behavior folks are seeing with R_HOME - they set it in the environment, but R embedded doesn't pick it up. So current theory (which is a good one) would be that PATH updates are similarly not being picked up/recognized. This assumes that the root cause is the PATH needs to be set so it can "find" the core R dlls. I did test explicitly setting my PATH in .NET code, and I confirmed within R.NET right before it calls R that the environment variable is there as I expected - and it was. So I know PATH wasn't being overridden somewhere after I thought I set it. Some references:
|
Not sure this is adding a lot of knowledge, but just confirmation via MSYS2 environment (from Rtools42) that unless the path is set to include the R core DLLs, it'll fail to load stats.dll
|
Further confirmation R's view of
Produces:
Note that my R directory exists in the
Calling
Finally, calling
|
This workaround appears to fix the issue. I'm not satisfied yet though, because I want to know why this is happening!!
|
Thanks for the workaround, that's really nice! Regarding where it's coming from, here's a long shot: this stack overflow comment talks about some ways that R PATH being set on startup. I searched the referenced folder, C:\Program Files\R\R-4.2.0\etc> ls * | select-string "PATH"
Rcmd_environ:38:R_RTOOLS42_PATH="${RTOOLS42_HOME:-c:/rtools42}/x86_64-w64-mingw32.static.posix/bin;${RTOOLS42_HOME:-c:/rtools42}/usr/bin"
Rcmd_environ:39:# trailing slash to protect against trailing backslash in PATH
Rcmd_environ:40:PATH="${R_CUSTOM_TOOLS_PATH:-${R_RTOOLS42_PATH}};${PATH}/"
Rprofile.site:12:# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library") |
Awesome find @nhirschey!!! Thanks so much. rdotnet doesn't itself explicitly call But along those lines, I think the
|
I'm still confused why setting the |
Workarounds that are available:
|
Just to add some info, I am using R 4.2.2 and workaround 3 didnt work, but workaround 2 worked like a charm. |
Please, how did you setup your F# project and get it to work. I am having no luck. |
Using R version 4.2.0 on Windows, this prior issue with loading
stats.dll
#127 seems to have resurfaced.Here, I show that
rnorm
works with R 4.0.2 but fails with R 4.2.0.Works with old R version 4.0.2
Fails with R version 4.2.0
The text was updated successfully, but these errors were encountered: