Split an interaction'ed factor back into seperate variables
Inverse of interaction
invinteraction(fac, ..., sep = ".")
fac |
the factor to split |
... |
optional, names for variables |
sep |
the seperator between levels |
a data.frame of factors
Refactored to process the levels vector, rather than entire factor vector.
42, Neal Fultz
f1 <- gl(2, 3) f2 <- gl(3, 2) invinteraction(f1:f2, sep=':') ppl <- interaction( eyes = as.factor(sample(colors(), 10)), hair = as.factor(sample(colors(), 10)) ) str(invinteraction(ppl, "eyes", "hair"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.