fac.divide {dae} | R Documentation |
Takes a factor
and divides it into several individual
factors
as if the levels
in the original combined.factor
are numbered from one to its number of levels and correspond
to the numbering of the levels
combinations of the individual
factors
when these are arranged in standard or Yates order.
fac.divide(combined.factor, factor.names, order="standard")
combined.factor |
A |
factor.names |
A |
order |
Either |
A data.frame
whose columns consist of the factors
listed in
factor.names
and whose values have been computed from the combined
factor
. All the factors
will be of the same length.
A single factor
name may be supplied in the list
in which case
a data.frame
is produced that contains the single factor
computed from the numeric vector
. This may be useful when calling
this function
from others.
Chris Brien
fac.split
, fac.uncombine
, fac.combine
in package dae.
## generate a small completely randomized design for 6 treatments
n <- 12
CRD.unit <- list(Unit = n)
treat <- factor(rep(1:4, each = 3))
CRD.lay <- designRandomize(allocated = treat, recipient = CRD.unit, seed=956)
## divide the treatments into two two-level factors A and B
CRD.facs <- fac.divide(CRD.lay$treat, factor.names = list(A = 2, B = 2))