Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

formulate

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

Examples

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

mlr3misc

Helper Functions for 'mlr3'

v0.10.0
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Patrick Schratz [aut] (<https://orcid.org/0000-0003-0748-6624>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.