Hi,

(sending it to the list as well)

according to the documentation of s.class{ade4}:
fac is "a factor partitioning the rows of the data frame in classes"

In your function call you passed "c(63) " as the respective parameter. "c(63)" is a vector with a single numerical value (63) in it. So the function can't find a factor which  it can use to "partition the rows of the data frame in classes ". According to your last mail "c(63) is (a,b,c)". How so? Maybe it is a naming problem, because c() is the name of an R function and you tried to use it as a variable name?


Greetings,
Finn


RIFCON GmbH
Goldbeckstraße 13
D-69493 Hirschberg
Tel: +49-6201 84528-24
Email: finn.bastiansen@rifcon.de<mailto:finn.bastiansen@rifcon.de>

RIFCON GmbH - Zinkenbergweg 8 - D-69493 Hirschberg
Goldbeckstraße 13 - D-69493 Hirschberg
Amtsgericht Mannheim - HRB 433053 - Ust.IdNr. DE 814188954 - www.rifcon.de<http://www.rifcon.de/>
Geschäftsführer: Dr. Michael Riffel
Prokura: Jürgen Riffel / Dr. Jan-Dieter Ludwigs

Von: Mahnaz Rabbaniha [mailto:rab.mahnaz@gmail.com]
Gesendet: Freitag, 22. November 2013 11:23
An: Finn Bastiansen
Betreff: Re: [R-sig-eco] pca in ade4

thanks for your answer.

the c(1:62) is numerical  and  c(63) is (a,b,c)
this file is the same to the (deug data) in example of pca in ade4 package.

but i donot know what is different?

thanks

On Fri, Nov 22, 2013 at 1:23 PM, Finn Bastiansen <Finn.Bastiansen@rifcon.de<mailto:Finn.Bastiansen@rifcon.de>> wrote:
Dear Mahnaz,

I do not use that specific library, however, judging from the structure of the resulting object ("str(deug.dudi)") it only contains numerical data. However, a factorial variable is expected by the function you use ("factor expected for fac "). Thus you have to convert the respective variable to factors to make the function happy :-)

Have a look in the R documentation on how to do that:

?factor
?as.factor

Hope that helps,
Finn

RIFCON GmbH
Goldbeckstraße 13
D-69493 Hirschberg
Tel: +49-6201 84528-24
Email: finn.bastiansen@rifcon.de<mailto:finn.bastiansen@rifcon.de>

RIFCON GmbH - Zinkenbergweg 8 - D-69493 Hirschberg
Goldbeckstraße 13 - D-69493 Hirschberg
Amtsgericht Mannheim - HRB 433053 - Ust.IdNr. DE 814188954 - www.rifcon.de<http://www.rifcon.de>
Geschäftsführer: Dr. Michael Riffel
Prokura: Jürgen Riffel / Dr. Jan-Dieter Ludwigs


-----Ursprüngliche Nachricht-----
Von: Mahnaz Rabbaniha [mailto:rab.mahnaz@gmail.com<mailto:rab.mahnaz@gmail.com>]
Gesendet: Freitag, 22. November 2013 10:39
An: r-sig-ecology
Betreff: [R-sig-eco] pca in ade4
Dear all

for pca on my data i used this code

deug.dudi <- dudi.pca(c(1:62), center =c(63),scale = FALSE, scan = FALSE)

s.class(deug.dudi$li, c(63), cpoint = 1)

but i take this message:
*Error in s.class(deug.dudi$li, c(63), cpoint = 1) : *
*  factor expected for fac*
please explain, what is meaning of this error


thanks
--
Mahnaz Rabbaniha
marine Ecologist, PhD
Iranian Fisheries Research Organization (IFRO)
P.O.Box: 14155-6116
Tehran, IRAN
Phone:   +98 21 44580953
Fax:       +98 21 44580583
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org<mailto:R-sig-ecology@r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

DISCLAIMER: This e-mail transmission may contain confide...{{dropped:13}}

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org<mailto:R-sig-ecology@r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



--
Mahnaz Rabbaniha
marine Ecologist, PhD
Iranian Fisheries Research Organization (IFRO)
P.O.Box: 14155-6116
Tehran, IRAN
Phone:   +98 21 44580953
Fax:       +98 21 44580583






DISCLAIMER: This e-mail transmission may contain confidential or legally privileged information that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender, so that we can arrange for proper delivery, and then please delete the message from your system. The original of this e-mail was scanned for viruses, but you should always use your own virus-scanning software to ensure mail and attachments are safe to open. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties.

	[[alternative HTML version deleted]]

