Learn R Programming

Momocs (version 1.0.0)

PCcontrib: Shape variation along PC axes

Description

Calculates and plots shape variation along Principal Component axes.

Usage

PCcontrib(PCA, ...)
"PCcontrib"(PCA, nax = 1:4, 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
a single or a range of PC axes
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

a ggplot object

Examples

Run this code
data(bot)
bot.p <- PCA(efourier(bot, 12))
PCcontrib(bot.p)
## Not run: 
# 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 + geom_polygon(fill="slategrey", col="black") + ggtitle("A nice title")
# ## End(Not run)

Run the code above in your browser using DataLab