I am using R 4.2.0 on Windows 11. When I load the rstan library, the R session is aborted. It says, "R encountered a fatal error. The session was terminated." See the screenshot below.
Asked
Active
Viewed 215 times
0
-
1Are you able to load in a normal R session outside of RStudio? – Dason May 25 '22 at 21:05
-
Are you on Windows? – Mossa May 25 '22 at 21:12
-
My answer to all of these questions these days is "try `cmdstanr` instead of `rstan`" ... – Ben Bolker May 25 '22 at 21:13
-
Also present the results from `path.expand("~")` and `Sys.getenv("HOME")`. – Mossa May 25 '22 at 21:13
-
And this: `Sys.which("gcc")`. – Mossa May 25 '22 at 21:14
-
possibly relevant https://stackoverflow.com/questions/72168874/rstan-and-brms-cause-r-and-rstudio-session-abort . Also further things to try at github link at answer link – user20650 May 25 '22 at 21:26
1 Answers
1
I reinstalled the most recent version of everything: R (4.2), RStudio (2022.02.2 Build 485)
, Rtools (4.2)
, rstan (2.26.x)
. Then, I changed the R_LIBS_USER
library. I can now run rstan in RStudio. I think changing the R_LIBS_USER
solved the problem.

user438383
- 5,716
- 8
- 28
- 43

Paul
- 107
- 4