1. Requirements
2. Linux
-
Note: Do not install on a headless machine because R and RStudio require a graphical user interface.
2.1. Installation
-
Enter the following commands at a Command Line.
apt-get install r-cran-rstan
3. Windows
3.1. Configuration of C++ Toolchain
3.2. Uninstallation
-
Start R with administrative privileges.
-
Enter the following commands at the Command Prompt.
remove.packages("rstan") if (file.exists(".RData")) file.remove(".RData") -
Close R.
3.3. Installation
-
Note: Remove any previous version (see above).
-
Start R with administrative privileges.
-
Enter the following commands at the Command Prompt.
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos"))) install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos"))) example(stan_model, package = "rstan", run.dontrun = TRUE) # See https://blog.mc-stan.org/2022/04/26/stan-r-4-2-on-windows install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos"))) cmdstanr::check_cmdstan_toolchain(fix = TRUE) cmdstanr::install_cmdstan() # if you already had the latest version of CmdStan install # cmdstanr::install_cmdstan(overwrite = TRUE) fit <- cmdstanr::cmdstanr_example() fit
-
Close R.
3.4. Configuration
-
Todo: