Learn R Programming

Momocs (version 0.1-01)

pca2shp: Reconstructs a shape given using PCA.

Description

Provided with a harmonic matrix coefficient on which to perform PCA, and given the $(PC_1; PC_2)$ coordinates, it reconstructs the corresponding shape.

Usage

pca2shp(pc1 = 0, pc2 = 0, data, nb.h = ncol(data)/4, nb.pts = 500,
		amp = 1, col = "black", lwd = 2, plot = TRUE)

Arguments

pc1
numeric indicating the position on the first PC axis
pc2
numeric indicating the position on the second PC axis
data
the harmonic coefficient matrix
nb.h
integer indication how many harmonics to use
nb.pts
integer indicating the number of points sampled from the reconstructed outlines
amp
numeric indicating the magnifying factor
col
integer or character indicating the color to ue for drawing the shape
lwd
numeric indicating the lwd for the shape
plot
code{logical} indicating whether to plot the shape

Examples

Run this code
data(bottles.nef)
pca2shp(0.5, 0.5, bottles.nef@coeff, amp=2)
pca2shp(0, 0, bottles.nef@coeff) # "average" shape

Run the code above in your browser using DataLab