fapply: Apply Formulas to a Model

Description Usage Arguments Details Value Examples

View source: R/fapply.R

Description

fapply returns a list of the same length as formulas. Each element is the result of applying modelthe the corresponding element of formulas.

Usage

1
fapply(formulas, model, ...)

Arguments

formulas

a list of formulas or objects coercible to formula by stats::as.formula.

model

a function taking a formula as its first argument.

...

additional arguments to be passed to model.

Details

This is a member of the apply family. It is similar to lapply, but handles the call slightly differently. This makes the output prettier.

Value

fapply returns a list of evaluated function calls.

Examples

1
2
3
formulas = subformula(mpg ~ cyl + disp, protected = ~ cyl)
fapply(formulas, lm, data = mtcars) # Pretty output.
lapply(formulas, lm, data = mtcars) # Less pretty output.

subformula documentation built on Nov. 16, 2019, 1:07 a.m.