PCcontrib: Shape variation along PC axes

PCcontribR Documentation

Shape variation along PC axes

Description

Calculates and plots shape variation along Principal Component axes.

Usage

PCcontrib(PCA, ...)

## S3 method for class 'PCA'
PCcontrib(PCA, nax, sd.r = c(-2, -1, -0.5, 0, 0.5, 1, 2), gap = 1, ...)

Arguments

PCA

a PCA object

...

additional parameter to pass to coo_draw

nax

the range of PCs to plot (1 to 99pc total variance by default)

sd.r

a single or a range of mean +/- sd values (eg: c(-1, 0, 1))

gap

for combined-Coe, an adjustment variable for gap between shapes. (bug)Default to 1 (whish should never superimpose shapes), reduce it to get a more compact plot.

Value

(invisibly) a list with gg the ggplot object and shp the list of shapes.

Examples

bot.p <- PCA(efourier(bot, 12))
PCcontrib(bot.p, nax=1:3)

library(ggplot2)
gg <- PCcontrib(bot.p, nax=1:8, sd.r=c(-5, -3, -2, -1, -0.5, 0, 0.5, 1, 2, 3, 5))
gg$gg + geom_polygon(fill="slategrey", col="black") + ggtitle("A nice title")


Momocs documentation built on Nov. 13, 2023, 5:07 p.m.

Related to PCcontrib in Momocs...