Learn R Programming

Momocs (version 0.2-6)

coo.centpos: Calculates the position of the centroid of a list or a matrix of coordinates.

Description

coo.centpos returns the centroid position of the shape that is the mean of x and y coordinates.

Usage

coo.centpos(coo)

Arguments

coo
A list or a matrix of coordinates.

Value

  • Returns the (x; y) coordinates of the centroid.

See Also

coo.centsize.

Examples

Run this code
data(bot)
coo <- bot@coo[[1]]
coo.plot(coo, cent=FALSE) # we do not plot the centroid
cent <- coo.centpos(coo)
points(cent[1], cent[2], pch=3, cex=5, col="red")

Run the code above in your browser using DataLab