% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract_list_of_variable_arrays.R
\name{extract_list_of_variable_arrays}
\alias{extract_list_of_variable_arrays}
\alias{extract_list_of_variable_arrays.default}
\alias{extract_list_of_variable_arrays.draws}
\title{Extract arrays of multiple variables}
\usage{
extract_list_of_variable_arrays(x, variables = NULL, ...)

\method{extract_list_of_variable_arrays}{default}(x, variables = NULL, ...)

\method{extract_list_of_variable_arrays}{draws}(x, variables = NULL, ...)
}
\arguments{
\item{x}{(draws) A \code{draws} object or another \R object for which the method
is defined.}

\item{variables}{A character vector of variable names to extract, or NULL to
extract all variables. To extract all dimensions from variables with
indices (e.g. \code{"x[1]"}), provide the base variable names
(e.g. \code{"x"}).}

\item{...}{Arguments passed to individual methods (if applicable).}
}
\value{
A named list of arrays, where each array has dimension
\code{niterations(x)} x \code{nchains(x)} x any remaining
dimensions determined by the indices of the variable \code{x}
(if \code{with_chains = TRUE}) or dimension
\code{niterations(x) * nchains(x)} x any remaining dimensions
(if \code{with_chains = FALSE}).
}
\description{
Extract arrays of draws for multiple variables, returning them as a named list
of arrays. Each array has the same structure as returned by
\code{\link{extract_variable_array}}.
}
\examples{
x <- example_draws(example = "multi_normal")

# Extract multiple variables at once
vars <- extract_list_of_variable_arrays(x, c("mu", "Sigma"))
str(vars)

# Extract all variables (uses base variable names)
all_vars <- extract_list_of_variable_arrays(x)
str(all_vars)

# Extract specific indexed variables
vars2 <- extract_list_of_variable_arrays(x, c("mu[1]", "mu[2]"))
str(vars2)

}
\seealso{
Other variable extraction methods: 
\code{\link{extract_variable}()},
\code{\link{extract_variable_array}()},
\code{\link{extract_variable_matrix}()}
}
\concept{variable extraction methods}
