e1 OP e2 OP e1
"data.frame"
.
If both arguments inherit from data frames, the operation is applied to
the corresponding pairs of variables.
The method is currently narrow minded about matching columns.
If both arguments are data frames, they must match exactly in dimensions.
This could easily be relaxed, but only by making a somewhat arbitrary decision
about extending the shorter of the frames.
If one argument is a data frame and the other is not,
the procedure depends on the mode of the other operand.
If that operand is a list, the method tries to figure out whether it
is intended to be a single variable or to have one element per variable,
by looking at its length.
If the non-data-frame operand is not a list it is assumed to
be a vector or matrix to be used in the corresponding
default operator.
The data frame
is turned into a matrix, and the default method for the operation is applied.
This means, for example, that comparison operations will be applied
to character data if there are any non-numeric
variables in the data frame.
Arithmetic operations will fail if there are any non-numeric variables,
as they should.
This is a group method for the functions of the
Op
s group,
the basic operators for arithmetic, comparison, and logic.
While the method is not itself restrictive with regards to the kind of
variable in the data frame, the inherited method applied to the columns
will likely fail for non-numeric variables and any of the arithmetic operators.