Something went wrong. Try again.
[mirror] R Package for a Mildly Opinionated Stan Bayesian Workflow stanflow.visruth.com
Something went wrong. Try again.
2.2 kB · 66 lines
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667% 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)}\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 fromR-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)}}}\value{Returns attached package names invisibly.}\description{This function ensures specific Stan interfaces are installed, configured,and loaded. It handles package installation (from R-multiverse/CRAN (stable) or Stanuniverse (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 functionfor specifics.}\examples{\dontrun{options(mc.cores = 2)setup_interface("cmdstanr", quiet = TRUE)setup_interface( c("brms", "cmdstanr"), brms_backend = "cmdstanr", quiet = TRUE)}}