paste_formula: paste a formula as string

Description Usage Arguments Details Value Examples

Description

paste a formula as string

Usage

1
paste_formula(Formula, exclude_y = FALSE, clean = FALSE)

Arguments

Formula

a formula to be pasted.

exclude_y

a boolean, whether to exclude y when paste. Default is FALSE.

clean

a boolean, whether to clean dirty formula: for example – price ~ cut + carat - cut will be cleaned into price ~ carat. Default is FALSE.

Details

a pasted formula in string, with all spaces deleted. This function uses get_y and get_x behind the scene.

Value

a pasted formula in string, with all spaces deleted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
paste_formula(price~carat +cut)
paste_formula(price~carat + cut)

paste_formula(price~carat +cut,exclude_y = TRUE)
paste_formula(Formula = price ~ cut + carat, clean = TRUE)

paste_formula(price~carat +cut - cut, clean = TRUE)

# irregular formulas: cross lines
paste_formula(price~carat +
                cut ~ dsad)

paste_formula(price~carat +
                cut ~ dsad,exclude_y = TRUE)

Fan-Yang-Econ/linear.tools_github documentation built on May 6, 2019, 4:34 p.m.