get_brmsfit: Extract the fitted brms model from a workflow

View source: R/fit_4pl.R

get_brmsfitR Documentation

Extract the fitted brms model from a workflow

Description

Returns the underlying brms::brmsfit object held in a bayes_tls workflow, ready for any brms / posterior / bayesplot helper (e.g. brms::bayes_R2(), brms::mcmc_plot(), posterior::as_draws_df()). Prefer this over reaching into workflow$fit directly: it errors clearly on an unfitted workflow instead of silently returning NULL. Pairs with the predicate has_fit().

Usage

get_brmsfit(workflow)

Arguments

workflow

A fitted bayes_tls workflow returned by fit_4pl().

Value

The brmsfit object stored in the workflow.

Examples

## Not run: 
wf  <- fit_4pl(std)
fit <- get_brmsfit(wf)
brms::bayes_R2(fit)

## End(Not run)

bayesTLS documentation built on Nov. 29, 2026, 1:06 a.m.