Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_variables

Get the names of the variables in a fitted Bayesian model


Description

Get a character vector of the names of the variables in a variety of fitted Bayesian model types. All models supported by tidy_draws() are supported.

Usage

get_variables(model)

## Default S3 method:
get_variables(model)

## S3 method for class 'mcmc'
get_variables(model)

## S3 method for class 'mcmc.list'
get_variables(model)

Arguments

model

A supported Bayesian model fit. Tidybayes supports a variety of model objects; for a full list of supported models, see tidybayes-models.

Details

This function is often useful for inspecting a model interactively in order to construct calls to spread_draws() or gather_draws() in order to extract draws from models in a tidy format.

Value

A character vector of variable names in the fitted model.

Author(s)

Matthew Kay

See Also

Examples

data(line, package = "coda")
get_variables(line)

data(RankCorr, package = "ggdist")
get_variables(RankCorr)

tidybayes

Tidy Data and 'Geoms' for Bayesian Models

v2.3.1
GPL (>= 3)
Authors
Matthew Kay [aut, cre], Timothy Mastny [ctb]
Initial release
2020-10-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.