0

bayes_factor in brms causes R and Rstudio session abort. I deleted and reinstalled both R and Rstudio. At first it wouldn’t fit brm() models but after I tried

remove.packages(c("StanHeaders", "rstan"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

that worked fine. Now I can set priors and fit models for brm but when I get to the bayes_factor() line both R and Rstudio crash. I know this asked a similar question, but it was a bug from nearly a year ago and some of my brms does work.

I load

library(rstanarm)
library(rstan)
library(brms)
library(BayesFactor)
library(bridgesampling)

Any idea what could help?

> sessionInfo()
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.3  tools_4.2.3     rstudioapi_0.14

enter image description here

Bommby
  • 35
  • 4
  • Does this code abort if you use different GUI? – zx8754 Apr 13 '23 at 07:46
  • I'm not even that familiar with (base) R or RStudio so those are the only ones I tried. – Bommby Apr 13 '23 at 07:48
  • If it happens outside of Rstudio, you can rule out the IDE as a source of the problem. Could it be a memory size issue? How much data are you using it on? – Phil Apr 13 '23 at 15:46
  • not a lot, i dont have data yet so generated a fake set (so that can be easily adjusted if its a problem) – Bommby Apr 14 '23 at 08:19

0 Answers0