fac.gen {dae}  R Documentation 
Generate all combinations of several factors and, optionally, replicate them.
fac.gen(generate, each=1, times=1, order="standard")
generate 
A 
each 
The number of times to replicate consecutively the elements of the

times 
The number of times to repeat the whole generated pattern of

order 
Either 
The levels
of each factor
are generated in a hierarchical
pattern, such as standard
order
, where the levels
of one
factor
are held constant while those of the adjacent factor
are cycled through the complete set once. If a number is supplied instead of a name,
the pattern is generated as if a factor
with that number of levels
had been supplied in the same position as the number. However, no levels
are
stored for this unamed factor
.
A data.frame
of factors
whose generated levels
are those supplied in the generate
list. The number of rows in the
data.frame
will equal the product of the numbers of levels of the
supplied factors
and the values of the each
and times
arguments.
Avoid using factor names F and T as these might be confused with FALSE and TRUE.
Chris Brien
fac.genfactors
, fac.combine
in package dae
## generate a 2^3 factorial experiment with levels  and +, and
## in Yates order
mp < c("", "+")
fnames < list(Catal = mp, Temp = mp, Press = mp, Conc = mp)
Fac4Proc.Treats < fac.gen(generate = fnames, order="yates")
## Generate the factors A, B and D. The basic pattern has 4 repetitions
## of the levels of D for each A and B combination and 3 repetitions of
## the pattern of the B and D combinations for each level of A. This basic
## pattern has each combination repeated twice, and the whole of this
## is repeated twice. It generates 864 A, B and D combinations.
gen < list(A = 3, 3, B = c(0,100,200), 4, D = c("0","1"))
fac.gen(gen, times=2, each=2)