Re: [R] factors and mca

From: Peter Alspach <PAlspach_at_hortresearch.co.nz>
Date: Wed 03 May 2006 - 06:34:51 EST

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@stat.math.ethz.ch
> [mailto:r-help-bounces@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@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}}



R-help@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 Received on Wed May 03 07:49:26 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 03 May 2006 - 10:09:58 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.