aggregatingFunction1or2() creates statistical summaries for functions like
var() that can have either 1 or 2 numeric vector inputs.
Usage
aggregatingFunction1or2(
fun,
output.multiple = FALSE,
na.rm = getOption("na.rm", FALSE)
)Details
This was designed primarily to support var which can be used to compute
either the variance of one variable or the covariance of two variables.
The logic of the resulting function is this: 1) If the first two arguments are both formulas,
then those formulas are evaluated (with data) to compute the covariance;
(2) If the first argument is a formula, and the second is NULL,
then the formula and data are used to create the necessary call(s) to fun;
(3) Else everything is simply passed to fun for evaluation.