mpone | R Documentation |
Converts the first two levels
of a factor
into the numeric
values -1 and +1.
mpone(factor)
factor |
The |
A numeric vector
.
If the factor
has more than two levels
they will
be coerced to numeric values.
Chris Brien
mpone
in package dae, factor
,
relevel
.
## generate all combinations of two two-level factors
mp <- c("-", "+")
Frf3.trt <- fac.gen(list(A = mp, B = mp))
## add factor C, whose levels are the products of the levles of A and B
Frf3.trt$C <- factor(mpone(Frf3.trt$A)*mpone(Frf3.trt$B), labels = mp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.