expandDoubleVerts {lme4} | R Documentation

## Expand terms with `'||'` notation into separate `'|'` terms

### Description

From the right hand side of a formula for a mixed-effects model, expand terms with the double vertical bar operator into separate, independent random effect terms.

### Usage

      expandDoubleVerts(term)

### Arguments

`term` | a mixed-model formula

### Value

the modified term

### Note

Note that `||` works at the level of formula parsing. This fact can lead to results that may be confusing when factors occur to the left of the `||` sign (more info at https://github.com/lme4/lme4/issues/229).

### See Also

`formula`, `model.frame`, `model.matrix`.

Other utilities: `mkRespMod`, `mkReTrms`, `nlformula`, `nobars`, `subbars`

### Examples

      f <- y ~ x + (x || g)
      # the right-hand side of f is,
      f[[3]]
      # the expanded right-hand side,
      expandDoubleVerts(f[[3]])

[Package lme4 version 1.1-11 Index]