Learn R Programming

brokenstick (version 1.1.0)

parse_formula: Parse formula for brokenstick model

Description

A bare bones formula parser to extract variables names from formulas of y ~ x | g. It return the name of the first variable mentioned in each formula component.

Usage

parse_formula(f)

Arguments

f

formula object

Value

A list with elements x, y and g. Each element has length 1.

Examples

Run this code
# NOT RUN {
# examples that yield identical result
parse_formula(y ~ x | z)
parse_formula(y + a ~ x + x1 | z + b)
parse_formula(y + a + log(b) ~ x + x1 * c | z + d)
# }

Run the code above in your browser using DataLab