Extract components from a formula with the form y ~ x1 + ... + xn | g1 + ... + gm

parseGroupFormula(form)

Arguments

form

A formula of the form y ~ x1 + ... + xn | g1 + ... + gm

Value

If the formula is y ~ x1 + x2 | g1 + g2 the result is

model

y ~ x1 + x2

groups

g1 + g2

groupFormula

~ g1 + g2

Author

Søren Højsgaard, sorenh@math.aau.dk

Examples


gf1 <- parseGroupFormula(y ~ x1 + x2 | g1 + g2)
gf1
#> $model
#> y ~ x1 + x2
#> <environment: 0x5e00f9dd0ea8>
#> 
#> $groups
#> g1 + g2
#> 
#> $groupFormula
#> ~g1 + g2
#> <environment: 0x5e00fa31fab8>
#> 

gf2 <- parseGroupFormula( ~ x1 + x2 | g1 + g2)
gf2
#> $model
#> ~x1 + x2
#> <environment: 0x5e00f9dd0ea8>
#> 
#> $groups
#> g1 + g2
#> 
#> $groupFormula
#> ~g1 + g2
#> <environment: 0x5e00fab9ef90>
#>