Learn R Programming

spatialTailDep (version 1.0.2)

pairCoordinates: Function pairCoordinates

Description

Given a matrix of coordinates of locations and a matrix of indices of pairs of locations, returns a matrix with the coordinates of the pairs of locations.

Usage

pairCoordinates(locations, pairIndices)

Arguments

locations
A $d$ x 2 matrix containing the Cartesian coordinates of $d$ points in the plane.
pairIndices
A $q$ x 2 matrix containing the indices of $q$ pairs of points.

Value

A $q$ x 4 matrix, where each row gives the Cartesian coordinates of the two locations in the corresponding pair.

See Also

selectPairIndices

Examples

Run this code
(locations<-cbind(rep(1:2,3),rep(1:3,each=2)))
(pairs <- selectPairIndices(locations, maxDistance = 1.5))
pairCoordinates(locations, pairs)

Run the code above in your browser using DataLab