fapply {subformula}R Documentation

Apply Formulas to a Model

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

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

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

[Package subformula version 0.1.0 Index]