Create or extract information about which components are used by a model, or
its individual observation models. If a non-NULL labels
argument is
supplied, also calls bru_used_update()
on the bru_used
objects.
Usage
bru_used(x = NULL, ...)
# S3 method for default
bru_used(
x = NULL,
...,
effect = NULL,
effect_exclude = NULL,
latent = NULL,
labels = NULL
)
# S3 method for character
bru_used(
x,
...,
effect = NULL,
effect_exclude = NULL,
latent = NULL,
labels = NULL
)
# S3 method for expression
bru_used(
x,
...,
effect = NULL,
effect_exclude = NULL,
latent = NULL,
labels = NULL
)
# S3 method for formula
bru_used(
x,
...,
effect = NULL,
effect_exclude = NULL,
latent = NULL,
labels = NULL
)
# S3 method for bru
bru_used(x, ..., join = TRUE)
# S3 method for list
bru_used(x, ..., join = TRUE)
# S3 method for bru_like
bru_used(x, ...)
# S3 method for bru_used
bru_used(x, labels = NULL, ...)
# S3 method for bru_used
print(x, ...)
Arguments
- x
An object that contains information about used components
- ...
Parameters passed on to the other methods
- effect
character; components used as effects. When
NULL
, auto-detect components to include or include all components.- effect_exclude
character; components to specifically exclude from effect evaluation. When
NULL
, do not specifically exclude any components.- latent
character; components used as
_latent
or_eval()
. WhenNULL
, auto-detect components.- labels
character; component labels passed on to
bru_used_update()
- join
Whether to join list output into a single object; Default may depend on the input object class
Value
A bru_used
object (a list with elements effect
and latent
), or a list of such objects
(for methods with join = FALSE
)
Methods (by class)
bru_used(default)
: Create abru_used
object.bru_used(character)
: Create abru_used
object from acharacter
representation of an expression.bru_used(expression)
: Create abru_used
object from an expression object.bru_used(formula)
: Create abru_used
object from a formula (only the right-hand side is used).bru_used(bru_used)
: Convenience method that takes an existingbru_used
object and callsbru_used_update()
iflabels
is non-NULL.
See also
Other bru_used:
bru_used_update()
,
bru_used_vars()
Examples
(used <- bru_used(~.))
#> Used effects :
#> Used latent :
bru_used(used, labels = c("a", "c"))
#> Used effects : a, c
#> Used latent :
(used <- bru_used(~ a + b + c_latent + d_latent))
#> Used effects : a, b
#> Used latent : c, d
bru_used(used, labels = c("a", "c"))
#> Used effects : a
#> Used latent : c
(used <- bru_used(expression(a + b + c_latent + d_latent)))
#> Used effects : a, b
#> Used latent : c, d
bru_used(used, labels = c("a", "c"))
#> Used effects : a
#> Used latent : c