Rstan 2.27

I would like to know what is the latest version of Stan available for R, since I would like to use version 2.27 and currently using 2.21.

I didn´t find an official instalation method for that version of stan in R, and the automatic installation still returns 2.21. (Any links on this or commands to pass from 2.21 to 2.27 would help as well)


cmdstanr allows you to use more recent versions. Have you tried that?

yeah I tried both

install.packages(“cmdstanr”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))



and when running


I still get 2.21 as an answer


> library(cmdstanr)
This is cmdstanr version
- Online documentation and vignettes at
- CmdStan path set to: /Users/foo/.cmdstanr/cmdstan-2.27.0
- Use set_cmdstan_path() to change the path
> cmdstan_version()
[1] "2.27.0"

cmdstan and rstan are not the same thing :)


Installing it doensn´t give me a problem , but when writing

y get

This is cmdstanr version 0.4.0
- Online documentation and vignettes at
- Use set_cmdstan_path() to set the path to CmdStan
- Use install_cmdstan() to install CmdStan

and in setting the path either Null or

Error in os.path.join("path", "to", "cmdstan") : 
  could not find function "os.path.join"

Both give problems.

(Thanks so much for the help by the way, still trying to figure things out)

First, check that your toolchain is setup properly,


Next, install cmdstan (you’ve installed cmdstanr only at the moment, I believe),

install_cmdstan(cores = 4) if you have four cores in your computer.

The check gives me

Other C++ toolchains installed on your system conflict with RTools.
Please run check_cmdstan_toolchain(fix = TRUE) to fix the issue.

Which I´ve found in other threads to have different possible causes?
I should try and fix that before installing cmdstan im guessing haha