Using Stan from R

I’ve been trying to get the hang of Bayesian models with Stan. One of the hurdles has been using Stan from R, so in this post I’m jotting down what I’ve learned (mostly the hard way). RStan or CmdStanR? On the whole I had a much better time using CmdStanR than RStan . When I made a mistake that led to a runtime exception, RStan would simply die with this kind of error: Error in `unserialize()`: !…