Arrange Response as a Array

DESCRIPTION:
Returns an array that is equivalent to the design or data frame given as input.

USAGE:
design.table(design, response=<<see below>>)

REQUIRED ARGUMENTS:
design:
a data frame representing a design, perhaps with a response included.
response:
a response variable. If omitted, the first non-factor included in design is used.

VALUE:
an array, whose elements are formed from the response. Suppose d is a numeric vector whose elements are the number of levels in each of the factors in the design. Then the dimension attribute of the array is d if there are no replicated values in the design, or c(nrep,d) otherwise, where nrep is the maximum number of replications. The dimnames attribute of the array is the factor names of design, with an initial element of 1:nrep if there are replications.

DETAILS:
Rearranging the response as an array makes more sense for complete designs. The function will work fine for fractional designs; the resulting array will include NAs. Such designs are usually easier to look at just by printing them, but using design.table on them will show you the pattern of missing observations. If you have some functions that work on arrays with NAs, the value of design.table can be used whether the design is complete or not.

Note that this will not work for designs that are severely fractional, such as many orthogonal array designs, since it will try to create an array that is too large.


SEE ALSO:
plot.design .