R Interface to Stan
Overview
User-facing R functions are provided to parse, compile, test, estimate, and analyze Stan models by accessing the header-only Stan library provided by the 'StanHeaders' package. The Stan project develops a probabilistic programming language that implements full Bayesian statistical inference via Markov Chain Monte Carlo, rough Bayesian inference via 'variational' approximation, and (optionally penalized) maximum likelihood estimation via optimization. In all three cases, automatic differentiation is used to quickly and accurately evaluate gradients without burdening the user with the need to derive the partial derivatives.
Install
Health
NOTER code for possible problemsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64
Found calls to structure() using deprecated special names: rstan/tests/testthat/test-misc_inst.R (.Dim: 1) '.Dim' should be changed to 'dim'.
- NOTE8 OK, 5 NOTENow
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-06-08
- WARNING12 OK, 1 WARNING2026-06-07
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-04-22
Show 2 earlier changesHide 2 earlier changes
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 44 (1 internal)includes a package overview page
- Examples that run
- 47%17 run in a plain check · 19 never run
- Exported functions with examples
- 79%
- Documented parameters
- 90%
- Return-value docs
- 86%
- Help pages citing references
- 41%
Downloads
Repository
- PRs merged (all time)
- 84%
- Median days to close, 50 most recently updated closed issues
- 4
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
11 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/stan-dev/rstan on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Funding links: GitHub Sponsors, mc-stan.org
The repository owner accepts GitHub Sponsors
GitHub Pages site last deployed 2026-10-17 · The repository has a site deploy workflow
pkgdown site last built 2025-12-10
Show all practicesHide 2 practices
Dependencies
Installing rstan adds 46 packages (21 with compiled code, 41 MB of source tarballs). Heaviest: BH 14 MB, ggplot2 6.0 MB, loo 2.7 MB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 158 more dependents and 65 packages that suggest it on CRAN ↗
Code & Tests
People & History
Show 5 peopleHide 5 people
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 2.32.7Latest
- RR 4.4.0 released · 2024-04-24
- 2.32.62024-03-05 · diff ↗
- 2.32.52024-01-10 · diff ↗
- 2.32.32023-10-15 · diff ↗
- 2.26.232023-09-08 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 2.21.82023-01-17 · diff ↗
- 2.21.72022-09-08 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 2.21.52022-04-11 · diff ↗
- 2.21.3
- RR 4.1.0 released · 2021-05-18
- 2.21.22020-07-27 · diff ↗
Show 28 earlier eventsHide 28 earlier events
- 2.21.1
- RR 4.0.0 released · 2020-04-24
- 2.19.32020-02-11 · diff ↗
- 2.19.2
- RR 3.6.0 released · 2019-04-26
- 2.18.22018-11-07 · diff ↗
- 2.18.12018-10-16 · diff ↗ ·
added 12 exports
get_divergent_iterations, get_max_treedepth_iterations, get_num_leapfrog_per_iteration, get_num_divergent, get_num_max_treedepth, get_bfmi, get_low_bfmi_chains, get_rng, get_stream, RNG, OUT, loo - 2.17.42018-10-01 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 2.17.32018-01-20 · diff ↗
- 2.17.22017-12-21 · diff ↗ ·
added 4 exports
check_hmc_diagnostics, check_divergences, check_treedepth, check_energy - 2.16.22017-07-03 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 2.15.12017-04-19 · diff ↗
- 2.14.22017-03-19 · diff ↗
- 2.14.12016-12-28 · diff ↗
- 2.13.22016-12-18 · diff ↗
- 2.12.12016-09-12 · diff ↗
- 2.11.12016-07-29 · diff ↗
- 2.10.12016-06-24 · diff ↗
- RR 3.3.0 released · 2016-05-03
- 2.9.0-32016-02-12 · diff ↗
- 2.9.02016-01-05 · diff ↗
- 2.8.22015-11-27 · diff ↗
- 2.8.1
- 2.8.02015-09-19 · diff ↗ ·
added 15 exports
stan_plot, stan_trace, stan_hist, stan_dens, stan_scat, stan_ac, stan_diag, stan_par, stan_rhat, stan_ess, stan_mcse, rstan_gg_options, rstan_ggtheme_options, quietgg, extract_sparse_parts - 2.7.0-12015-07-18
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-07-18
- Total releases
- 32 / 11 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 3.4.0
- Download size
- 1.5 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("rstan")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.