% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/used.R
\name{new_bru_used}
\alias{new_bru_used}
\alias{new_bru_used.NULL}
\alias{new_bru_used.character}
\alias{new_bru_used.expression}
\alias{new_bru_used.quosure}
\alias{new_bru_used.formula}
\title{Store information about used components}
\usage{
new_bru_used(
  x = NULL,
  ...,
  effect = NULL,
  effect_exclude = NULL,
  latent = NULL,
  labels = NULL
)

\method{new_bru_used}{`NULL`}(
  x = NULL,
  ...,
  effect = NULL,
  effect_exclude = NULL,
  latent = NULL,
  labels = NULL
)

\method{new_bru_used}{character}(
  x,
  ...,
  effect = NULL,
  effect_exclude = NULL,
  latent = NULL,
  labels = NULL
)

\method{new_bru_used}{expression}(
  x,
  ...,
  effect = NULL,
  effect_exclude = NULL,
  latent = NULL,
  labels = NULL
)

\method{new_bru_used}{quosure}(
  x,
  ...,
  effect = NULL,
  effect_exclude = NULL,
  latent = NULL,
  labels = NULL
)

\method{new_bru_used}{formula}(
  x,
  ...,
  effect = NULL,
  effect_exclude = NULL,
  latent = NULL,
  labels = NULL
)
}
\arguments{
\item{x}{\code{NULL}, or an object representing an expression}

\item{\dots}{Parameters passed on to the other methods}

\item{effect}{character; components used as effects. When \code{NULL}, auto-detect
components to include all components in a predictor expression.}

\item{effect_exclude}{character; components to specifically exclude from
effect evaluation. When \code{NULL}, do not specifically exclude any components.}

\item{latent}{character; components used as \verb{_latent} or \verb{_eval()}. When
\code{NULL}, auto-detect components.}

\item{labels}{character; component labels passed on to
\code{\link[=bru_used_update]{bru_used_update()}}}
}
\value{
A \code{bru_used} object (a list with elements \code{effect}
and \code{latent})
}
\description{
Create a \code{bru_used} object from effect name character
vectors.
Create information about which components are used by a model, or
its individual observation models. If a non-NULL \code{labels} argument is
supplied, also calls \code{\link[=bru_used_update]{bru_used_update()}} on the \code{bru_used} object.
}
\details{
The arguments \code{effect}, \code{effect_exclude}, and \code{latent} control what
components and effects are available for use in predictor expressions.
\describe{
\item{\code{effect}}{
Character vector of component labels that are used as effects
by the predictor expression; If \code{NULL} (default), the names
are extracted from the formula.
}
\item{\code{exclude}}{
Character vector of component labels to be excluded from the effect list
even if they have been auto-detected as being necessary.
Default is \code{NULL}; do not remove any components from the inclusion list.
}
\item{\code{include_latent}}{Character vector.
Specifies which latent state variables need to be directly available to the
predictor expression, with a \verb{_latent} suffix. This also makes evaluator
functions with suffix \verb{_eval} available, taking parameters \code{main}, \code{group},
and \code{replicate}, taking values for where to evaluate the component effect
that are different than those defined in the component definition itself
(see \code{\link[=bru_comp_eval]{bru_comp_eval()}}). If \code{NULL}, the use of \verb{_latent} and \verb{_eval}
in the predictor expression is detected automatically.
}
}
}
\section{Methods (by class)}{
\itemize{
\item \code{new_bru_used(`NULL`)}: Create a \code{bru_used} object from effect name
character vectors.

\item \code{new_bru_used(character)}: Create a \code{bru_used} object from a \code{character}
representation of an expression.

\item \code{new_bru_used(expression)}: Create a \code{bru_used} object from an expression
object.

\item \code{new_bru_used(quosure)}: Create a \code{bru_used} object from an \code{rlang} \code{expr}
object.

\item \code{new_bru_used(formula)}: Create a \code{bru_used} object from a formula (only the
right-hand side is used).

}}
\examples{
(used <- new_bru_used(~.))
bru_used(used, labels = c("a", "c"))
(used <- new_bru_used(~ a + b + c_latent + d_latent))
bru_used(used, labels = c("a", "c"))
(used <- new_bru_used(expression(a + b + c_latent + d_latent)))
bru_used(used, labels = c("a", "c"))

}
\seealso{
Other bru_used: 
\code{\link{bru_used}()},
\code{\link{bru_used_update}()},
\code{\link{bru_used_vars}()}
}
\concept{bru_used}
\keyword{internal}
