Learn R Programming

CensSpatial (version 3.6)

distmatrix: Distance matrix

Description

It computes the euclidean distance matrix for a set of coordinates.

Usage

distmatrix(coords)

Value

dist

symetric matrix of distances between points.

Arguments

coords

2D spatial coordinates.

Author

Alejandro Ordonez <<ordonezjosealejandro@gmail.com>>, Victor H. Lachos <<hlachos@ime.unicamp.br>> and Christian E. Galarza <<cgalarza88@gmail.com>>

Maintainer: Alejandro Ordonez <<ordonezjosealejandro@gmail.com>>

References

Diggle, P. & Ribeiro, P. (2007). Model-Based Geostatistics. Springer Series in Statistics.

See Also

SAEMSCL

Examples

Run this code
n<-200
n1=100

####Simulating spatial coordinates##
r1=sample(seq(1,30,length=400),n+n1)
r2=sample(seq(1,30,length=400),n+n1)
coords=cbind(r1,r2)

H=distmatrix(coords)

Run the code above in your browser using DataLab