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

add_predictors

Add predictors to a formula


Description

This merges a one- or two-sided formula f with the right-hand sides of all formulas supplied in ....

Usage

add_predictors(f, ..., fun = "+")

Arguments

f

A formula.

...

Formulas whose right-hand sides will be merged to f.

fun

A function name indicating how to merge the right-hand sides.

Examples

f <- lhs ~ rhs
add_predictors(f, ~var1, ~var2)

# Left-hand sides are ignored:
add_predictors(f, lhs1 ~ var1, lhs2 ~ var2)

# fun can also be set to a function like "*":
add_predictors(f, ~var1, ~var2, fun = "*")

modelr

Modelling Functions that Work with the Pipe

v0.1.8
GPL-3
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

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