How to generate a new factor variable by two other factor variables?

For example, if I have two factor variables, factorA and factorB,
factorA factorB
    0       0
    0       0
    1       0
    0       1
    1       1

Is there a simple way to generate a new 4-levels factor variable as

factorC factorA factorB
    0      0       0
    0      0       0
    1      1       0
    2      0       1
    3      1       1

--
Shuguang Sun
Fudan University, China

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to