formulate: Create Formulas

View source: R/formulate.R

formulateR Documentation

Create Formulas

Description

Given the left-hand side and right-hand side as character vectors, generates a new stats::formula().

Usage

formulate(lhs = character(), rhs = character(), env = NULL, quote = "right")

Arguments

lhs

(character())
Left-hand side of formula. Multiple elements will be collapsed with " + ".

rhs

(character())
Right-hand side of formula. Multiple elements will be collapsed with " + ".

env

(environment())
Environment for the new formula. Defaults to NULL.

quote

(character(1))
Which side of the formula to quote? Subset of ⁠("left", "right")⁠, defaulting to "right".

Value

stats::formula().

Examples

formulate("Species", c("Sepal.Length", "Sepal.Width"))
formulate(rhs = c("Sepal.Length", "Sepal.Width"))

mlr3misc documentation built on Sept. 20, 2023, 5:06 p.m.