Skip to contents

Defines random effect terms using the lme4 syntax

Usage

re(formula)

Arguments

formula

A random effect as returned by lme4::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

See also

Functions used to help convert formulas into model designs as_string_formula(), construct_re(), construct_rw(), enw_formula(), enw_manual_formula(), parse_formula(), remove_rw_terms(), rw_terms(), rw(), split_formula_to_terms()

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"