geomean: Mean location of sperhical coordinates

Description Usage Arguments Value Author(s) Examples

View source: R/geomean.R

Description

mean location for spherical (longitude/latitude) coordinates that deals with the angularity. I.e., the mean of longitudes -179 and 178 is 179.5

Usage

1
geomean(xy, w)

Arguments

xy

matrix with two columns (longitude/latitude), or a SpatialPoints or SpatialPolygons object with a longitude/latitude CRS

w

weights (vector of numeric values, with a length that is equal to the number of spatial features in x

Value

Ccoordinate pair (numeric)

Author(s)

Robert J. Hijmans

Examples

1
2
3
xy <- cbind(x=c(-179,179, 177), y=c(12,14,16))
xy
geomean(xy)

Example output

Loading required package: sp
        x  y
[1,] -179 12
[2,]  179 14
[3,]  177 16
       x  y
[1,] 179 14

geosphere documentation built on July 21, 2018, 3 p.m.