# NOT RUN {
## two-sided formula
formulize("y", c("x1", "x2", "x3"))
## one-sided formula
formulize(x = c("x1", "x2", "x3"))
## multi-sided formula
formulize("y", c("x1", "x2", "x3"), c("z1", "z2"), "w1")
## can use numerics for column names
data(mockstudy)
formulize(y = 1, x = 2:4, data = mockstudy)
## mix and match
formulize(1, c("x1", "x2", "x3"), data = mockstudy)
## get an interaction
formulize("y", c("x1*x2", "x3"))
## use in an lm
form <- formulize(2, 3:4, data = mockstudy)
summary(lm(form, data = mockstudy))
# }
Run the code above in your browser using DataLab