Learn R Programming

switchSelection (version 2.0.0)

formula_split: Split formula by symbol

Description

This function splits one formula into two formulas by symbol.

Usage

formula_split(formula, symbol = "|")

Value

This function returns a list of two formulas.

Arguments

formula

an object of class formula.

symbol

a string that is used to split formula into two formulas.

Details

The symbol should be on the right hand side of the formula.

Examples

Run this code
formula_split("y ~ x1 + x2 | x2 + x3")
formula_split("y ~ x1 + x2 : x2 + x3", symbol = ":")

Run the code above in your browser using DataLab