powered by
take a name for a y variable and a vector of names for x variables and turn them into a formula
toformula(yname, xnames)
a formula
the name of the y variable
vector of names for x variables
toformula("yvar", c("x1", "x2")) ## should return yvar ~ 1 toformula("yvar", rhs.vars(~1))
Run the code above in your browser using DataLab