# Ensuring compatibility for CRAN-packages using rstan

**URL:** <https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648>\
**Category:** RStan\
**Tags:** rstantools, rstan\
**Created:** [June 7, 2023, 12:12pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648 "2023-06-07T12:12:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![novice](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/novice/32/10062_2.png) [@novice](https://discourse.mc-stan.org/u/novice)\
**Post date:** [June 7, 2023, 12:12pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648/1 "2023-06-07T12:12:42Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![maxbiostat](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/maxbiostat/32/1326_2.png) [@maxbiostat](https://discourse.mc-stan.org/u/maxbiostat)\
**Post date:** [June 7, 2023, 12:58pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648/2 "2023-06-07T12:58:14Z")

</div>

@bgoodri @jonah @andrjohns @rok_cesnovar

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [June 7, 2023, 1:06pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648/3 "2023-06-07T13:06:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![novice](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/novice/32/10062_2.png) [@novice](https://discourse.mc-stan.org/u/novice)\
**Post date:** [June 7, 2023, 1:19pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648/4 "2023-06-07T13:19:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [June 7, 2023, 1:21pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648/5 "2023-06-07T13:21:48Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![Berwin\_Turlach](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/berwin_turlach/32/11876_2.png) [@Berwin\_Turlach](https://discourse.mc-stan.org/u/Berwin_Turlach)\
**Post date:** [June 13, 2023, 5:39pm UTC](https://discourse.mc-stan.org/t/ensuring-compatibility-for-cran-packages-using-rstan/31648/6 "2023-06-13T17:39:40Z")

</div>

@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? :)
