Learn R Programming

Momocs (version 0.2-03)

coo.force2close: Forces a list or matrix or coordinates to close.

Description

coo.force2close force one coo to close, i.e. the difference $(x_n - x_1)/n$ is added to each x-coordinates and similarly for y-coordinates.

Usage

coo.force2close(coo)

Arguments

coo
A list or a matrix of coordinates.

Value

  • Returns a matrix of (x; y)coordinates.

Examples

Run this code
data(bot)
coo <- bot@coo[[1]]
coo.plot(coo, ylim=c(-200, 1200), xlim=c(0, 500), main="A half bottle forced to close")
coo.draw(coo[1:1500,], border="blue", col=NA)
coo.draw(coo.force2close(coo[1:1500, ]), border="red", col=NA)

Run the code above in your browser using DataLab