Learn R Programming

ezsim (version 0.5.5)

createFormula: Create Formula From a Vector of Character.

Description

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

Usage

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

See Also

formula

Examples

Run this code
## 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)

Run the code above in your browser using DataLab