Parse a formula object into its left-hand-side and right-hand-side components
Source:R/model-terms.r
model_terms.Rd
Parse a formula object into its left-hand-side and right-hand-side components
Value
list with named elements "lhs" and "rhs", containing variables on each respective side of the equation
Examples
# Set up a hypothetical function, then decompose into left-hand and
# right-hand sides
form <- formula(outcome ~ treatment + confounder + unit + time)
model_terms(form)
#> $lhs
#> [1] "outcome"
#>
#> $rhs
#> [1] "treatment" "confounder" "unit" "time"
#>