extract_variable {posterior} | R 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_df'
extract_variable(x, variable, ...)
## S3 method for class 'draws_list'
extract_variable(x, variable, ...)
## S3 method for class 'draws_rvars'
extract_variable(x, variable, ...)
Arguments
x |
(draws) A |
variable |
(string) The name of the variable to extract. Must include
indices for array variables (e.g. |
... |
Arguments passed to individual methods (if applicable). |
Value
A vector of length equal to the number of draws.
See Also
Other variable extraction methods:
extract_variable_array()
,
extract_variable_matrix()
Examples
x <- example_draws()
mu <- extract_variable(x, variable = "mu")
str(mu)
[Package posterior version 1.6.0 Index]