interaction {base} | R Documentation |
interaction
computes a factor which represents the interaction
of the given factors. The result of interaction
is always unordered.
interaction(..., drop=FALSE)
... |
The factors for which interaction is to be computed, or a single list giving those factors. |
drop |
If |
A factor which represents the interaction of the given factors.
Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth \& Brooks/Cole.
factor
.
a <- gl(2, 2, 8)
b <- gl(2, 4, 8)
interaction(a, b)