PWMatrix: Creates a sparse pairwise distance matrix of a coordinate set

Description Usage Arguments Value Examples

View source: R/PWMatrix.R

Description

Creates a sparse pairwise distance matrix of a coordinate set

Usage

1
PWMatrix(Coords)

Arguments

Coords

- Two-dimensional array of longitudinal and latitudinal coordinates output from CoordCollapse() function

Value

Returns a sparse pairwise distance matrix of great circle distances between pairs of points

Examples

1
2
3
4
longs<-runif(10,-22,33)
lats<-runif(10,-22,33)
Coords<-CoordCollapse(longs,lats)
PWMatrix(Coords)

Example output

   X1       X2        X3       X4       X5       X6        X7        X8
1  NA 2612.523  945.5816 3504.901 1090.023 3983.505 4213.4879 3996.4831
2  NA       NA 3212.3247 5966.259 2318.781 3052.908 3210.3373 3715.8267
3  NA       NA        NA 2754.539 1010.441 3756.918 3985.2612 3535.1911
4  NA       NA        NA       NA 3692.556 5735.574 5925.8948 5076.1026
5  NA       NA        NA       NA       NA 2920.215 3151.1724 2909.6077
6  NA       NA        NA       NA       NA       NA  231.0143  965.0705
7  NA       NA        NA       NA       NA       NA        NA 1033.3848
8  NA       NA        NA       NA       NA       NA        NA        NA
9  NA       NA        NA       NA       NA       NA        NA        NA
10 NA       NA        NA       NA       NA       NA        NA        NA
         X9      X10
1  4064.834 5830.611
2  4422.293 7250.157
3  3387.413 4890.923
4  4343.493 3628.302
5  3054.120 5230.003
6  1975.932 5104.495
7  2049.705 5155.317
8  1017.303 4139.575
9        NA 3135.231
10       NA       NA

GeoRange documentation built on June 20, 2017, 9:03 a.m.