dudi {ade4}R Documentation

Duality Diagram

Description

as.dudi is called by many functions (dudi.pca, dudi.coa, dudi.acm, ...) and not directly by the user. It creates duality diagrams.

t.dudi returns an object of class 'dudi' where the rows are the columns and the columns are the rows of the initial dudi.

is.dudi returns TRUE if the object is of class dudi

redo.dudi computes again an analysis, eventually changing the number of kept axes. Used by other functions.

Usage

as.dudi(df, col.w, row.w, scannf, nf, call, type, tol = 1e-07, 
    full = FALSE) 
## S3 method for class 'dudi':
print(x, ...) 
is.dudi(x) 
redo.dudi(dudi, newnf = 2) 
## S3 method for class 'dudi':
t(x) 

Arguments

df a data frame with n rows and p columns
col.w a numeric vector containing the row weights
row.w a numeric vector containing the column weights
scannf a logical value indicating whether the eigenvalues bar plot should be displayed
nf if scannf FALSE, an integer indicating the number of kept axes
call generally match.call()
type a string of characters : the returned list will be of class c(type, "dudi")
tol a tolerance threshold for null eigenvalues (a value less than tol times the first one is considered as null)
full a logical value indicating whether all non null eigenvalues should be kept
x, dudi objects of class dudi
... further arguments passed to or from other methods
newnf an integer indicating the number of kept axes

Value

as.dudi and all the functions that use it return a list with the following components :
tab a data frame with n rows and p columns
cw column weights, a vector with n components
lw row (lines) weights, a vector with p components
eig eigenvalues, a vector with min(n,p) components
nf integer, number of kept axes
c1 principal axes, data frame with p rows and nf columns
l1 principal components, data frame with n rows and nf columns
co column coordinates, data frame with p rows and nf columns
li row coordinates, data frame with n rows and nf columns
call original call

Author(s)

Daniel Chessel
Anne B Dufour dufour@biomserv.univ-lyon1.fr

References

Escoufier, Y. (1987) The duality diagram : a means of better practical applications In Development in numerical ecology, Legendre, P. & Legendre, L. (Eds.) NATO advanced Institute, Serie G. Springer Verlag, Berlin, 139–156.

Examples

data(deug)
dd1 <- dudi.pca(deug$tab, scannf = FALSE)
dd1
t(dd1)
is.dudi(dd1)
redo.dudi(dd1,3)

Worked out examples


> library(ade4)
> ### Name: dudi
> ### Title: Duality Diagram
> ### Aliases: dudi as.dudi print.dudi t.dudi is.dudi redo.dudi
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> data(deug)
> dd1 <- dudi.pca(deug$tab, scannf = FALSE)
> dd1
Duality diagramm
class: pca dudi
$call: dudi.pca(df = deug$tab, scannf = FALSE)

$nf: 2 axis-components saved
$rank: 9
eigen values: 3.101 1.363 1.032 0.9341 0.7398 ...
  vector length mode    content       
1 $cw    9      numeric column weights
2 $lw    104    numeric row weights   
3 $eig   9      numeric eigen values  

  data.frame nrow ncol content             
1 $tab       104  9    modified array      
2 $li        104  2    row coordinates     
3 $l1        104  2    row normed scores   
4 $co        9    2    column coordinates  
5 $c1        9    2    column normed scores
other elements: cent norm 
> t(dd1)
Duality diagramm
class: transpo dudi
$call: t.dudi(x = dd1)

$nf: 2 axis-components saved
$rank: 9
eigen values: 3.101 1.363 1.032 0.9341 0.7398 ...
  vector length mode    content       
1 $cw    104    numeric column weights
2 $lw    9      numeric row weights   
3 $eig   9      numeric eigen values  

  data.frame nrow ncol content             
1 $tab       9    104  modified array      
2 $li        9    2    row coordinates     
3 $l1        9    2    row normed scores   
4 $co        104  2    column coordinates  
5 $c1        104  2    column normed scores
other elements: NULL
> is.dudi(dd1)
[1] TRUE
> redo.dudi(dd1,3)
Duality diagramm
class: pca dudi
$call: dudi.pca(df = deug$tab, scannf = FALSE, nf = 3)

$nf: 3 axis-components saved
$rank: 9
eigen values: 3.101 1.363 1.032 0.9341 0.7398 ...
  vector length mode    content       
1 $cw    9      numeric column weights
2 $lw    104    numeric row weights   
3 $eig   9      numeric eigen values  

  data.frame nrow ncol content             
1 $tab       104  9    modified array      
2 $li        104  3    row coordinates     
3 $l1        104  3    row normed scores   
4 $co        9    3    column coordinates  
5 $c1        9    3    column normed scores
other elements: cent norm 
> 
> 
> 
> 

[Package ade4 Index]