extract_variable: Extract draws of a single variable

View source: R/extract_variable.R

extract_variableR Documentation

Extract draws of a single variable

Description

Extract a vector of draws of a single variable.

Usage

extract_variable(x, variable, ...)

## Default S3 method:
extract_variable(x, variable, ...)

## S3 method for class 'draws'
extract_variable(x, variable, ...)

## S3 method for class 'draws_rvars'
extract_variable(x, variable, ...)

Arguments

x

(draws) A draws object or another R object for which the method is defined.

variable

(string) The name of the variable to extract.

...

Arguments passed to individual methods (if applicable).

Value

A numeric vector of length equal to the number of draws.

Examples

x <- example_draws()
mu <- extract_variable(x, variable = "mu")
str(mu)


posterior documentation built on Nov. 2, 2023, 5:56 p.m.