Learn R Programming

Momocs (version 1.1.6)

scree: Methods for PCA eigen values

Description

A set of functions around PCA/LDA eigen/trace. scree calculates their proportion and cumulated proportion; scree_min returns the minimal number of axis to use to retain a given proportion; scree_plot displays a screeplot.

Usage

scree(x, nax)

# S3 method for PCA scree(x, nax = 1:10)

# S3 method for LDA scree(x, nax = 1:10)

scree_min(x, prop = 0.99)

scree_plot(x, nax = 1:10)

Arguments

x
a PCA object
nax
numeric range of axis to consider
prop
numeric how many axis are enough this proportion of variance, if too high then number of axis is returned.

Value

scree returns a data.frame, scree_min a numeric, scree_plot a ggplot.

Examples

Run this code
data(bot)
# On PCA
bp <- PCA(efourier(bot))
scree(bp)
scree_min(bp, 0.99)
scree_min(bp, 1)

scree_plot(bp)
scree_plot(bp, 1:5)

# on LDA, it uses svd
data(olea)
bl <- LDA(PCA(opoly(olea)), "var")
scree(bl)

Run the code above in your browser using DataLab