Learn R Programming

Momocs (version 0.2-6)

PC.contrib: Shape variation along PC axis

Description

PC.contrib calculates and plots shape variation along Principal Component axes.

Usage

PC.contrib(dudi, PC.r = 1:dudi$nf, sd = 2, cols = rep(NA, 3), 
    borders = c("#000080", "#000000", "#EE0000"), lwd = 1, nb.pts = 300, 
    plot = TRUE, legend = TRUE)

Arguments

dudi
a dudi.pca object.
PC.r
A range of integers indicating the PC axes on which to display shape variation.
sd
A numeric to indicate +/- the number of standard deviations to consider.
cols
A color string of length 3 to use to fill the shapes.
borders
A color string of length 3 to use for the shape borders.
lwd
A numeric to specify the lwd of the shapes.
nb.pts
integer to specify the number of points to draw the shapes.
plot
logical. Whether to plot the results.
legend
logical. Whether to add the legend.

Value

  • Invisibly returns a list that contains the coordiantes of the calculated shapes.

Examples

Run this code
data(bot)
#botF <- eFourier(bot)
#botD <- pca(botF)
#PC.contrib(botD)
#PC.contrib(botD, sd=1) # only one sd
#PC.contrib(botD, PC.r=1:3, sd=1, cols=paste(col.sari(3), "55", sep=""),
#   borders=rep("black", 3), legend=FALSE)
# only 3 PC axis and some cosmectics.

Run the code above in your browser using DataLab