Skip to contents

Defines random effect terms using the lme4 syntax

Usage

re(formula)

Arguments

formula

A random effect as returned by findbars when a random effect is defined using the lme4 syntax in formula. Currently only simplified random effects (i.e LHS | RHS) are supported.

Value

A list defining the fixed and random effects of the specified random effect

Examples

form <- epinowcast:::parse_formula(~ 1 + (1 | age_group))
re(form$random[[1]])
#> $fixed
#> [1] "1"
#> 
#> $random
#> [1] "age_group"
#> 
#> attr(,"class")
#> [1] "enw_re_term"

form <- epinowcast:::parse_formula(~ 1 + (location | age_group))
re(form$random[[1]])
#> $fixed
#> [1] "location"
#> 
#> $random
#> [1] "age_group"
#> 
#> attr(,"class")
#> [1] "enw_re_term"