rstan
(install.packages("rstan")
).cmdstanr
.From https://mc-stan.org/cmdstanr/articles/cmdstanr.html:
while (!require("cmdstanr")) {
install.packages("cmdstanr",
repos = c("https://mc-stan.org/r-packages/",
getOption("repos", "https://cloud.r-project.org")))
}
check_cmdstan_toolchain(fix = TRUE, quiet = TRUE)
orig_pkgs <- c(
## core
"lme4", "brms",
## model evaluation/testing/plotting
"broom.mixed", "tidybayes", "bayesplot", "posterior", "bayestestR",
## general purpose manipulation/plotting
"dplyr", "purrr", "cowplot",
"ggrastr", ## rasterize layers with lots of stuff
"see" ## for okabe-ito scales
)
ip <- installed.packages()
pkgs <- setdiff(orig_pkgs, rownames(ip))
if (length(pkgs)>0) install.packages(pkgs)
These examples were generated using the following package versions:
sapply(sort(c(orig_pkgs, "cmdstanr", "rstan")), \(x) as.character(packageVersion(x)))
## bayesplot bayestestR brms broom.mixed cmdstanr cowplot
## "1.10.0" "0.13.1" "2.20.4" "0.2.9.5" "0.7.1" "1.1.3"
## dplyr ggrastr lme4 posterior purrr rstan
## "1.1.2" "1.0.2" "1.1.35.1" "1.5.0" "1.0.1" "2.32.6"
## see tidybayes
## "0.8.2" "3.0.6"
cmdstanr::cmdstan_version()
## [1] "2.33.1"