# distm

From geosphere v1.2-15
by Robert Hijmans

##### Distance matrix

Distance matrix of a set of points, or between two sets of points

- Keywords
- spatial

##### Usage

```
distm(x, fun=distHaversine)
distm2(x, y, fun=distHaversine)
```

##### Arguments

- x
- longitude/latitude of point(s). Can be a vector of two numbers, a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialPoints* object
- y
- Same as
`x`

- fun
- A function to compute distances (e.g., distCosine, distHaversine, distVincenty*)

##### Value

- Matrix of distances

##### References

##### See Also

`distCosine, distHaversine, distVincentySphere, distVincentyEllipsoid`

##### Examples

```
xy <- rbind(c(0,0),c(90,90),c(10,10),c(-120,-45))
distm(xy)
xy2 <- rbind(c(0,0),c(10,-10))
distm2(xy, xy2)
```

*Documentation reproduced from package geosphere, version 1.2-15, License: GPL*

### Community examples

Looks like there are no examples yet.