findbars {lme4} | R Documentation |
From the right hand side of a formula for a mixed-effects model, determine the pairs of expressions that are separated by the vertical bar operator. Also expand the slash operator in grouping factor expressions and expand terms with the double vertical bar operator into separate, independent random effect terms.
findbars(term)
term |
a mixed-model formula |
pairs of expressions that were separated by vertical bars
This function is called recursively on individual terms
in the model, which is why the argument is called
term
and not a name like form
, indicating a
formula.
formula
, model.frame
,
model.matrix
.
Other utilities: mkRespMod
,
mkReTrms
, nlformula
,
nobars
, subbars
findbars(f1 <- Reaction ~ Days + (Days | Subject))
## => list( Days | Subject )
## These two are equivalent:% tests in ../inst/tests/test-doubleVertNotation.R
findbars(y ~ Days + (1 | Subject) + (0 + Days | Subject))
findbars(y ~ Days + (Days || Subject))
## => list of length 2: list ( 1 | Subject , 0 + Days | Subject)
findbars(~ 1 + (1 | batch / cask))
## => list of length 2: list ( 1 | cask:batch , 1 | batch)