This function computes the centroid of a set of x-y (or longitude-latitude) coordinates.

centroid(x, y, geo = FALSE)

Arguments

x

A vector of x (or longitude) coordinates.

y

A vector of y (or latitude) coordinates.

geo

A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.

Value

A two-element vector corresponding to the location of the centroid.

See also

Examples

# TODO