% Generated by roxygen2: do not edit by hand % Please edit documentation in R/interfaces.R \name{setup_interface} \alias{setup_interface} \title{Setup and Load Stan Interfaces} \usage{ setup_interface( interface = c("brms", "cmdstanr", "rstan", "rstanarm"), cores = getOption("mc.cores"), quiet = getOption("stanflow.quiet", FALSE), force = FALSE, reinstall = FALSE, check_updates = FALSE, dev = FALSE, brms_backend = c("cmdstanr", "rstan"), rstan_auto_write = TRUE, dry_run = FALSE ) } \arguments{ \item{interface}{A character vector. Select at least one of: "brms", "cmdstanr", "rstan", "rstanarm".} \item{cores}{Integer. Number of cores to use. Defaults to \code{getOption("mc.cores")}. You must set \code{options(mc.cores = ...)} or pass \code{cores} explicitly.} \item{quiet}{Logical. If \code{TRUE}, suppresses status messages. This cannot suppress cmdstan messages.} \item{force}{Logical. If \code{TRUE}, allows installation in non-interactive sessions.} \item{reinstall}{Logical. If \code{TRUE}, forces re-installation.} \item{check_updates}{Logical. If \code{TRUE}, checks for CmdStan updates.} \item{dev}{Logical. If \code{FALSE} (default), installs stable releases from R-multiverse or CRAN. If \code{TRUE}, installs development versions from Stan R-universe.} \item{brms_backend}{Character. The \code{brms} backend to use. Defaults to \code{getOption("brms.backend", "cmdstanr")} and must be one of \code{c("cmdstanr", "rstan")}.} \item{rstan_auto_write}{Logical. If \code{TRUE} (default), sets \code{rstan::rstan_options(auto_write = TRUE)}} \item{dry_run}{Logical. If \code{TRUE}, previews mutating setup actions without installing, attaching, changing options, or prompting. Dry-run output is shown even when \code{quiet = TRUE}.} } \value{ Returns attached package names invisibly. With \code{dry_run = TRUE}, returns the package names that would be attached. } \description{ This function ensures specific Stan interfaces are installed, configured, and loaded. It handles package installation (from R-multiverse/CRAN (stable) or Stan universe (dev)) and performs necessary one-time setup (like installing CmdStan). } \details{ The setup functions are exported (e.g., \code{setup_brms()}) for transparency. Each function has some side effects, mainly setting \code{mc.cores}, see the function for specifics. } \examples{ \dontrun{ options(mc.cores = 2) setup_interface("cmdstanr", quiet = TRUE) setup_interface( c("brms", "cmdstanr"), brms_backend = "cmdstanr", quiet = TRUE ) } }