[R] factors and mca

Carlos Mauricio Cardeal Mendes mcardeal at ufba.br
Tue May 2 22:22:43 CEST 2006


Hi ! Wonder if I have this code below:

a <- c(1, 2, 3, 2, 1)
b <- c(3, 2, 3, 1, 1)
d <-as.factor(a)
e <-as.factor(b)
table(d,e)
is.factor(a)
is.factor(b)
is.factor(d)
is.factor(e)
de <- factor(c(d,e))
is.factor(de)
require(MASS)
mca(de)

I'd like to perform a correspondence analysis, but I can't understand why the message error after mca.

Aren't those (d and e) factors as is.factors shows ?

 > Erro em mca(de) : all variables must be factors

I'm running R 2.3.0 under windows XP


Thank you !
Mauricio




More information about the R-help mailing list