Learn R Programming

Momocs (version 0.1-01)

tps.grid: Thin Plate Splines deformation grids between two shapes.

Description

Passed with a Nef-object, and two positions on the set defined by $PC_1$ and $PC_2$, calculates and plots deformation grids, "vector field" or iso-deformation lines between these two shapes.

Usage

tps.grid(Nef, fr, to, nb.pts = 50, amp = 1, grid.size = 50,
		 grid.col = "grey40", cont = TRUE,
		 cont.col = c("dodgerblue3", "firebrick3"), cont.lwd = rep(3,2)) 
		  
tps.iso(Nef, fr, to, nb.pts = 200, amp = 1, iso.pts = 1000,
		col.pal = topo.colors, col.lev = 500,
		cont.to = TRUE, cont.fr = TRUE,  cont.lev = 10,
		cont.col = c("dodgerblue3", "firebrick3"),  cont.lwd = rep(3,2))
			
tps.vf(Nef, fr, to, nb.pts = 100, amp = 1, arr.nb = 300, 
		arr.len = 0.05, arr.ang = 30, arr.col = "grey40",
		arr.pal = FALSE, arr.palette = topo.colors, arr.pal.lev = 20,
		arr.lwd = 1, cont.col = c("dodgerblue3", "firebrick3"),
		cont.lwd = rep(3, 2))

Arguments

Nef
the Nef object
fr
a vector with two numerics indicating the $(x; y)$ coordinates of the starting point. If not provided, locator(1) is called
to
a vector with two numerics indicating the $(x; y)$ coordinates of the ending point. If not provided, locator(1) is called
nb.pts
integer indicating the number of points used to calculate deformation grids
amp
a numeric indicating magnifying factor for deformations
cont
logical indicating whether to plot original and deformed shapes
cont.to
logical indicating whether to plot the original shape
cont.fr
logical indicating whether to plot the deformed shape
cont.col
integer or character indicating the col of the two outlines compared
cont.lwd
a numeric indicating a vector containing the lwd of the two outlines compared
grid.size
a numeric indicating deformation grid size
grid.col
code{integer} or a character indicatinf the deformation grid color
iso.pts
a integer indicating the number of iso points to use for isolines calculation
col.pal
a color palette such as rainbow, heat.colors or such as build by colorRampPalette for isolines drawing
col.lev
integer indicating how many color levels to use
cont.lev
integer indicating how many isolines to calculate
arr.nb
integer indicating how many arrows to display
arr.len
a numeric indicating the arrows length
arr.ang
a numeric indicating the arrows angle
arr.col
integer or a character indicating the arrows color
arr.pal
logical indicating whether to use or not a color palette for drawing arrows
arr.palette
a color palette such as rainbow, heat.colors or such as build by colorRampPalette
arr.pal.lev
integer specifying how many levels to use for the color palette
arr.lwd
a numeric indicating the arrows lwd

Examples

Run this code
data(bottles.nef)

tps.grid(bottles.nef, fr=c(-0.05, -0.05), to=c(0.15, 0.05))
tps.vf(bottles.nef, fr=c(-0.05, -0.05), to=c(0.15, 0.05))
tps.iso(bottles.nef, fr=c(-0.05, -0.05), to=c(0.15, 0.05))

Run the code above in your browser using DataLab