Creates an object of class
design, which inherits from
data.frame.
All columns are coerced to be factors.
USAGE:
design(..., factor.names=<<see below>>)
REQUIRED ARGUMENTS:
...
objects that can be interpreted as factors in a design:
vectors, data frames, matrices, or factors themselves.
Each object or column of a data frame or matrix will be considered as a template
for a factor.
Numeric vectors and matrices will be converted to factors, with the
unique values of the vector or the column of the matrix defining the levels.
All objects must have the same number of observations (number of rows
for matrices and data frames, length for other objects).
Missing values (NA) are allowed.
OPTIONAL ARGUMENTS:
factor.names=
vector or list for naming the factors.
If this is a vector, then it gives the names of the factors; if a list,
it also names the levels of the factors (the names of the list will be
the names of the factors).
If omitted, names will be constructed. In the case that the argument(s)
are matrices with
dimnames for the columns, these dimnames
will be used; otherwise, the standard factor names are used.
VALUE:
an object of class
design, inheriting from the class
data.frame.
This will have as many columns as are implied by the arguments, and
as many rows as there are observations in each argument.
DETAILS:
This function should be compared with
data.frame, which
does not force all variables to be factors, and with
data.matrix, which
in a sense performs the inverse operation to
design, by converting
factors to numeric variables.
SEE ALSO:
,
,
,
,
.
EXAMPLES:
# dmat is a numeric matrix with appropriate levels in the
# rows; myfac is a factor defined on the same observations.
mydesign <- design(dmat, myfac)