R/BMisc.R
toformula.Rd
take a name for a y variable and a vector of names for x variables and turn them into a formula
toformula(yname, xnames)
the name of the y variable
vector of names for x variables
a formula
toformula("yvar", c("x1", "x2")) #> yvar ~ x1 + x2 #> <environment: 0x55c776035d08> ## should return yvar ~ 1 toformula("yvar", rhs.vars(~1)) #> yvar ~ 1 #> <environment: 0x55c77619e020>