Minoo
Minoo

Reputation: 121

How to find value output of this example?

This is an example in the ade4 package in R

http://pbil.univ-lyon1.fr/ade4/ade4-html/dudi.fca.html

in the value section of "dudi.fca" of this paragraph is written:

Value
The function prep.fuzzy.var returns a data frame with the attribute col.blocks. The function dudi.fca returns a list of class fca and dudi (see dudi) containing also cr a data frame which rows are the blocks, columns are the kept axes, and values are the correlation ratios.

when I run the example, below, I only receive two graphs and no data frame for cr. I mean where could I find the defined cr i.e. correlation ratios, since it should be the output of whole command below?

#### needs ade4 package######  

data(bsetal97)
w <- prep.fuzzy.var(bsetal97$biol, bsetal97$biol.blo) 
scatter(dudi.fca(w, scann = FALSE, nf = 3), csub = 3, clab.moda = 1.5) 
scatter(dudi.fpca(w, scann = FALSE, nf = 3), csub = 3, clab.moda = 1.5)

Upvotes: 1

Views: 280

Answers (2)

Sven Hohenstein
Sven Hohenstein

Reputation: 81693

The function dudi.fca does also return a data frame. You can access it with $cr.

library(ade4)
data(bsetal97)
w <- prep.fuzzy.var(bsetal97$biol, bsetal97$biol.blo) 
res <- dudi.fca(w, scann = FALSE, nf = 3)

res$cr

#                      RS1         RS2        RS3
# Fem.Size      0.51767205 0.267870254 0.17495548
# Egg.length    0.63988941 0.285033226 0.41593113
# Egg.number    0.05747863 0.208236959 0.09355756
# Generations   0.10435866 0.196192350 0.04422504
# Oviposition   0.04986622 0.295212076 0.09379737
# Incubation    0.03564958 0.129598714 0.09254649
# Egg.shape     0.56977053 0.170656625 0.05772311
# Egg.attach    0.38473985 0.287414507 0.27998335
# Clutch.struc  0.19883866 0.191202779 0.39021869
# Clutch.number 0.28984896 0.002252787 0.08240764

Upvotes: 2

thothal
thothal

Reputation: 20329

Well, you are asking Rto produce a scatter plot of the output of dudi.fca and this is what R returns. If you are interested in the output of dudi.fca you should store the result for further inspection, for instance you can run:

scatter(ret <- dudi.fpca(w, scann = FALSE, nf = 3), csub = 3, clab.moda = 1.5)

And then you can use the result of ret. str(ret) will show you the structure of the returned object.

Upvotes: 2

Related Questions