a function that generalizes fun to handle a formula/data frame interface.
Arguments
fun
a function that takes a numeric vector and computes a summary statistic,
returning a numeric vector.
output.multiple
a boolean indicating whether fun returns multiple values
envir
an environment in which evaluation takes place.
na.rm
the default value for na.rm in the resulting function.
style
one of "formula1st", "formula2nd" or "flexible". In the first
two cases, the first argument must be a formula or evaluate to an object. In the latter case,
bare names will be converted into formulas.
Details
The logic of the resulting function is this: 1) If the first argument is a formula,
use that formula and data to create the necessary call(s) to fun; (2) Else simply
pass everything to fun for evaluation.