View source: R/fac.functions.r
| fac.uncombine | R Documentation |
Cleaves a single factor into several factors whose levels,
the levels of the original factor consisting of several delimited strings that
can be separated to form the levels of the new.factors. That is, it reverses the process
of combining factors that fac.combine performs.
fac.uncombine(factor, new.factors, sep=",", ...)
factor |
A |
new.factors |
A |
sep |
A |
... |
Further arguments passed to the |
A data.frame whose columns consist of the factors listed in
new.factors and whose values have been computed from the values of the combined
factor.
Chris Brien
fac.split, fac.combine, fac.divide in package dae and
strsplit.
## set up two factors and combine them
facs <- fac.gen(list(A = letters[1:3], B = 1:2), each = 4)
facs$AB <- with(facs, fac.combine(list(A, B), combine.levels = TRUE))
## now reverse the proces and uncombine the two factors
new.facs <- fac.uncombine(factor = facs$AB,
new.factors = list(A = letters[1:3], B = NULL),
sep = ",")
new.facs <- fac.uncombine(factor = facs$AB,
new.factors = list(A = NULL, B = NULL),
sep = ",")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.