Ensuring compatibility for CRAN-packages using rstan

I am wondering how to ensure that CRAN-packages relying on rstan are ready for new versions of rstan appearing on CRAN in the future.

Currently, rstan on CRAN is at 2.21.8. If I compile the models in my package using CmdStan 2.32.0, I get the following warning: “Declaration of arrays by placing brackets after a variable name is deprecated and will be removed in Stan 2.33.0. Instead use the array keyword before the type. This can be changed automatically using the auto-format flag to stanc”.

The skeleton for my package was created using rstantools. Is there an easy way to turn on auto-format, and will this ensure compatibility with future rstan versions on CRAN (until I switch to the new declaration format)?


@bgoodri @jonah @andrjohns @rok_cesnovar

Using auto-format or the new syntax is not compatible until rstan 2.26 is on CRAN. This should not be too far off now that StanHeaders was accepted


Ok, so the best approach is to wait for rstan 2.26, and then add auto-format or update the syntax before version 2.33?

1 Like



@andrjohns: StanHeader 2.26.25 appeared on CRAN nearly 4 weeks ago, and was since updated to 2.26.26.
So any idea what the “not to far off” actually means? :)

1 Like