The R Project SVN R

Rev

Rev 25360 | Rev 38838 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25360 Rev 26981
Line 3... Line 3...
3
\usage{
3
\usage{
4
interaction(\dots, drop = FALSE)
4
interaction(\dots, drop = FALSE)
5
}
5
}
6
\alias{interaction}
6
\alias{interaction}
7
\arguments{
7
\arguments{
8
  \item{\dots}{The factors for which interaction is to be computed, or a
8
  \item{\dots}{the factors for which interaction is to be computed, or a
9
    single list giving those factors.}
9
    single list giving those factors.}
10
  \item{drop}{If \code{drop} is \code{TRUE}, empty factor levels
10
  \item{drop}{if \code{drop} is \code{TRUE}, empty factor levels
11
    are dropped from the result. The default is to retain all
11
    are dropped from the result.  The default is to retain all
12
    factor levels.}
12
    factor levels.}
13
}
13
}
14
\description{
14
\description{
15
  \code{interaction} computes a factor which represents the interaction
15
  \code{interaction} computes a factor which represents the interaction
16
  of the given factors.  The result of \code{interaction} is always unordered.
16
  of the given factors.  The result of \code{interaction} is always unordered.
17
}
17
}
18
\value{
18
\value{
19
  A factor which represents the interaction of the given factors.
19
  A factor which represents the interaction of the given factors.
-
 
20
  The levels are labelled as the levels of the individual factors joined
-
 
21
  by \code{.}.
20
}
22
}
21
\references{
23
\references{
22
  Chambers, J. M. and Hastie, T. J. (1992)
24
  Chambers, J. M. and Hastie, T. J. (1992)
23
  \emph{Statistical Models in S}.
25
  \emph{Statistical Models in S}.
24
  Wadsworth \& Brooks/Cole.
26
  Wadsworth \& Brooks/Cole.
25
}
27
}
-
 
28
\seealso{
26
\seealso{\code{\link{factor}}.}%% even more ":" for factors!
29
  \code{\link{factor}}, \code{\link{:}}
-
 
30
}
27
 
31
 
28
\examples{
32
\examples{
29
a <- gl(2, 2, 8)
33
a <- gl(2, 2, 8)
30
b <- gl(2, 4, 8)
34
b <- gl(2, 4, 8)
31
interaction(a, b)
35
interaction(a, b)