Learn R Programming

Momocs (version 0.2-6)

meanShapes: Calculate groups mean shapes from Coe

Description

meanShapes calculates mean shapes of groups defined through the @fac slot and using the appropriate inverse Fourier method.

Usage

meanShapes(Coe,
           fac,
           nb.pts=300)

Arguments

Coe
A Coe object on which to define landmarks.
fac
One of the factor names of Coe@fac. See examples below.
nb.pts
The number of points to use for calculation shapes.

Examples

Run this code
data(bot)
botF <- eFourier(bot)

meanShapes(botF) # average shape
shp.type <- meanShapes(botF, "type")
panel(Coo(shp.type), borders=col.gallus(2)) # use Coo plotting facilities !

# below we combine another Fourier approach, one more factor, and one panel plot with names.
bot@fac <- data.frame(type=bot@fac[, 1], plop=rep(letters[1:4], each=10))
botR <- rFourier(bot)
shp.plop <- meanShapes(botR, "plop")
panel(Coo(shp.plop), cols=col.summer(4), names=TRUE)

Run the code above in your browser using DataLab