[R] factors and mca

Peter Alspach PAlspach at hortresearch.co.nz
Tue May 2 22:34:51 CEST 2006


Carlos

?mca states that mca works on a dataframe.  As you've written it

is.data.frame(de) returns FALSE

Try

de <- data.frame(d,e)  instead of  de <- factor(c(d,e))

HTH

Peter Alspach



> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Carlos
> Mauricio Cardeal Mendes
> Sent: Wednesday, 3 May 2006 8:23 a.m.
> To: 'R-Help help'
> Subject: [R] factors and mca
>
> 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
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

______________________________________________________

The contents of this e-mail are privileged and/or confidenti...{{dropped}}




More information about the R-help mailing list