Decomposes a formula into fixed effects and random effects by walking the formula's abstract syntax tree. This is structural recursion with pattern matching on bar terms – no string manipulation.
Value
A list with:
response: character, the response variable label (NULLif none)response_expr: language object, the LHS of~(NULLif none)fixed_formula: formula, the fixed-effects-only formularandom_effects: list of parsed RE specificationsn_re_terms: integer, number of RE termslatent_blocks: list of evaluated user-defined latent block objects (typicallytgmrfS3 objects), one perlatent(...)term in the original formula. Empty list when nolatent(...)terms are present.n_latent_blocks: integer, number oflatent(...)termsoriginal: the original formula