Compute the Interaction of Several Factors

DESCRIPTION:

Computes the interaction of several factors and returns a new factor with levels that represent all combinations of the factors supplied as arguments.

USAGE:

interaction(design, drop = F) 
interaction(..., drop = F) 

REQUIRED ARGUMENTS:

design
...
the arguments to interaction can be either a data frame containing all the factors to be used orall the individual factors. It will not understand a combination of factors and designs as arguments; you have to pick one form or the other.

OPTIONAL ARGUMENTS:

drop
if TRUE the levels of the new factor not represented in the data are dropped.

VALUE:

a new factor, whose levels are all possible combinations of the factors supplied as arguments. If drop = T, only the levels represented in the new factor are retained.

EXAMPLES:

  attach(catalyst) 
  Temp 
[1] 160 180 160 180 160 180 160 180 
  Conc 
[1] 20 20 40 40 20 20 40 40 
  interaction(Temp, Conc) 
[1] 160.20 180.20 160.40 180.40 160.20 180.20 160.40 180.40