createFormula: Create Formula From a Vector of Character.

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/createFormula.r

Description

Elements of the vector is evenly distributed to both of the formula. Each element in the formula is seperated by +.

Usage

1
createFormula(x, right = TRUE)

Arguments

x

A vector of character

right

If there is only one element in x, should it appear in the left or right hand side of the formula.

Value

Formula

Note

For internal use of ezsim. It aims at creating formula for facets in ggplot2.

Author(s)

TszKin Julian Chan ctszkin@gmail.com

See Also

formula

Examples

1
2
3
4
5
6
7
8
## Not run: 
createFormula(letters[1])  ## . ~ a
createFormula(letters[1],right=FALSE)  ## a ~ .
createFormula(letters[1:3])  ## c ~ a + b
createFormula(letters[1:4])  ## c + d ~ a + b
createFormula(letters[1:4],right=FALSE) ## a + b ~ c + d

## End(Not run)

ezsim documentation built on May 1, 2019, 8:04 p.m.