toformula: Variable Names to Formula

View source: R/BMisc.R

toformulaR Documentation

Variable Names to Formula

Description

take a name for a y variable and a vector of names for x variables and turn them into a formula

Usage

toformula(yname, xnames)

Arguments

yname

the name of the y variable

xnames

vector of names for x variables

Value

a formula

Examples

toformula("yvar", c("x1","x2"))

## should return yvar ~ 1
toformula("yvar", rhs.vars(~1))


BMisc documentation built on July 12, 2022, 1:05 a.m.