Slot "mode" error with brms

Hello,
I get this error after running several models

 Error in FUN(X[[i]], trying to get slot "mode" from an object of a basic class ("NULL") with no slots

This has been discussed with Rstan although it is not clear what was the solution here:

The only thing is when I restart R and reopen it I can run the syntax so can it be a memory issue within R?
Any advice is appreciated.

1 Like

Unfortunately rstan is not very great at those error messages :-(

The most likely cuplrit is that some of the chains didnā€™t finish correctly. So running on a single core (or just a single chain) is likely to show more info.

Alternatively, you can try switching to using the cmdstanr package instead of Rstan and see if the issue persists (installation instructions: Getting started with CmdStanR ā€¢ cmdstanr, then call options(brms.backend = "cmdstanr")

Best of luck with your model!