powered by
fapply returns a list of the same length as formulas. Each element is the result of applying modelthe the corresponding element of formulas.
fapply
formulas
model
fapply(formulas, model, ...)
a list of formulas or objects coercible to formula by stats::as.formula.
a function taking a formula as its first argument.
formula
additional arguments to be passed to model.
fapply returns a list of evaluated function calls.
This is a member of the apply family. It is similar to lapply, but handles the call slightly differently. This makes the output prettier.
apply
lapply
call
# NOT RUN { formulas = subformula(mpg ~ cyl + disp, protected = ~ cyl) fapply(formulas, lm, data = mtcars) # Pretty output. lapply(formulas, lm, data = mtcars) # Less pretty output. # }
Run the code above in your browser using DataLab