# Brms without rStan but with CmdStanR?

**URL:** <https://discourse.mc-stan.org/t/brms-without-rstan-but-with-cmdstanr/26351>\
**Category:** Interfaces\
**Tags:** rstan, brms, cmdstanr\
**Created:** [February 14, 2022, 10:02pm UTC](https://discourse.mc-stan.org/t/brms-without-rstan-but-with-cmdstanr/26351 "2022-02-14T22:02:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonicking](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sonicking](https://discourse.mc-stan.org/u/sonicking)\
**Post date:** [February 14, 2022, 10:02pm UTC](https://discourse.mc-stan.org/t/brms-without-rstan-but-with-cmdstanr/26351/1 "2022-02-14T22:02:06Z")

</div>

Hi, my R does not have rStan because I could not get the Makevars to work. Instead, I use CmdStanR and it works.

The Brms package seems to require rStan to function properly. Please correct me if I am wrong. I also see that Brms has a backend option with CmdStan, but I need to research more on this. Can I install and run Brms properly on my machine? Thanks

---

<div class="post-metadata">

**Author:** ![mike-lawrence](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mike-lawrence/32/59_2.png) [@mike-lawrence](https://discourse.mc-stan.org/u/mike-lawrence)\
**Post date:** [February 17, 2022, 8:06pm UTC](https://discourse.mc-stan.org/t/brms-without-rstan-but-with-cmdstanr/26351/2 "2022-02-17T20:06:24Z")

</div>

Yup. You just need to install both brms & cmdstanr, run `cmdstanr::install_cmdstan()`, then use the `backend` argument when using `brms::brm()` thereafter, for example:

```r
brms::brm( 
    ... # model stuff here
    , backend = "cmdstanr"
)

```

---

<div class="post-metadata">

**Author:** ![davidh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/davidh/32/3334_2.png) [@davidh](https://discourse.mc-stan.org/u/davidh)\
**Post date:** [June 10, 2024, 8:30pm UTC](https://discourse.mc-stan.org/t/brms-without-rstan-but-with-cmdstanr/26351/3 "2024-06-10T20:30:42Z")

</div>

@mike-lawrence thanks for the suggestion! I’m just curious how people actually go about installing brms without rstan? Trying to install brms without rStan installed seems to result in an error because it is a dependency, i.e.,

```no-highlight
install.packages("brms", dependencies = FALSE)

```

results in

```no-highlight
ERROR: dependency ‘rstan’ is not available for package ‘brms’
* removing ‘brms’

```

---

<div class="post-metadata">

**Author:** ![jsocolar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jsocolar/32/2486_2.png) [@jsocolar](https://discourse.mc-stan.org/u/jsocolar)\
**Post date:** [June 10, 2024, 10:26pm UTC](https://discourse.mc-stan.org/t/brms-without-rstan-but-with-cmdstanr/26351/4 "2024-06-10T22:26:43Z")

</div>

You need to have the `rstan` package installed, but you don’t need to actually be set up to compile and run models with `rstan`.
