Overview

CmdStanR is a lightweight interface to Stan for R users (see CmdStanPy for Python).

If you are new to CmdStanR we recommend starting with these vignettes:

Goals

  • A clean interface to Stan services so that CmdStanR can keep up with Stan releases.

  • R code that doesn’t interface directly with C++, only calls compiled executables.

  • Modularity: CmdStanR runs Stan’s algorithms and lets downstream modules do the analysis.

  • Flexible BSD-3 license.

Installation

Installing the R package

You can install the beta release of the cmdstanr R package with

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

or you can install the latest development version from GitHub:

# install.packages("remotes")
remotes::install_github("stan-dev/cmdstanr")

Installing CmdStan

If you don’t already have CmdStan installed then, in addition to installing the R package, it is also necessary to install CmdStan using CmdStanR’s install_cmdstan() function. A suitable C++ toolchain is also required. Instructions are provided in the Getting started with CmdStanR vignette.

Contributing

There is a lot of work still to be done and contributions are very welcome! If you are interested in contributing please comment on an open issue or open a new one if none are applicable.

License

CmdStanR, like CmdStan and the core Stan C++ code, is licensed under new BSD. See the LICENSE.md file.