.makeAdditiveExpr
Helper functions for makeAdditiveFormula
Description
The functions build the left and right hand sides of the formula produced by makeAdditiveFormula.
They may be used directly to build complicated formula.
Usage
.makeAdditiveExpr(exprs, emptyExprsOutput = 1)
Arguments
exprs |
A character vector of variable names or a list of expressions to use as terms in the output expression.
|
emptyExprsOutput |
What to output if there are no entries in exprs.
|
Details
We don't expect users to need to call these function much. Use the
simpler makeAdditiveFormula when possible.
Value
If there is just one entry in exprs then that is returned, unaltered.
If there are multiple entries then .makeAdditiveExpr returns
an expression of the form expr1 + expr2 + ... and
.makeCbindExpr returns an expression of the form
cbind(expr1, expr2, ...).
See Also
makeAddtiveFormula.
Examples
.makeAdditiveExpr(c("one", "two"))
.makeAdditiveExpr(character())
.makeAdditiveExpr(list(quote(log(one)), quote(sqrt(two))))
.makeCbindExpr(c("one","two"))
.makeCbindExpr(c("one"))