Learn R Programming

Momocs (version 0.2-6)

pca: A wrapper for dudi.pca on Coe-objects.

Description

pca is a wrapper for dudi.pca in ade4 on Coe-objects.

Usage

pca(Coe, subset.fac=NULL,
         subset.lev=NULL,
		 row.w,
		 col.w,
		 center=TRUE,
		 scale=FALSE,
		 scannf=FALSE,
		 nf=3)

Arguments

Coe
The Coe object
subset.fac
If non NULL, a character to specify the grouping factor on which to perform the PCA.
subset.lev
If non NULL for subset.fac, then a character to specify the level of subset.fac on which to perform the PCA.
row.w
A vector giving the rows weights (see Details).
col.w
A vector giving the cols weights (see Details).
center
logical. Whether to center or not the harmonic coefficients.
scale
logical. Whether to scale or not the harmonic coefficients.
scannf
logical. Whether to ask or not the number of PC to retain.
nf
integer. If scannf is FALSE, then the number of PC to retain.

Value

  • Returns a dudi.pca object

Details

The default parameters should be satisfying for most of the cases. For instance, amplitude of coefficients is not rescaled since first harmonics capture most of the information. See the reference below for further technical discussion on PCA on harmonic coefficients.

References

See the papers below that introduce ade4 and also the package's homepage: http://pbil.univ-lyon1.fr/ADE-4/ Dray, S. and Dufour, A.B. (2007): The ade4 package: implementing the duality diagram for ecologists. Journal of Statistical Software. 22(4): 1-20. Chessel, D. and Dufour, A.B. and Thioulouse, J. (2004): The ade4 package-I- One-table methods. R News. 4: 5-10. Dray, S. and Dufour, A.B. and Chessel, D. (2007): The ade4 package-II: Two-table and K-table methods. R News. 7(2): 47-52.

See Also

dudi.pca.

Examples

Run this code
data(bot)
botE <- eFourier(bot)
botP <- pca(botE)
dudi.plot(botP, "type")
beer <- pca(botE, "type", "beer")
dudi.plot(beer)
whisky <- pca(botE, "type", "whisky")
dudi.plot(whisky)

Run the code above in your browser using DataLab