point2points.distances: Calculate the Euclidian distance between a point (centroid)...

View source: R/misc.R

point2points.distancesR Documentation

Calculate the Euclidian distance between a point (centroid) and the locations of STW sites

Description

Examples

Usage

point2points.distances(coord.pt, coord.pts)

Details

For a single point, point2points.distances(c(3,4),matrix(1:6,ncol=2))

For multiple points, t(apply(cbind(rep(3,2),rep(4,2)),1,function(x) point2points.distances(x,matrix(1:6,ncol=2))))

Run time for all England LSOA centroids takes around 20 minutes n <- 100 system.time( m <- t(apply(cbind(rep(3,n),rep(4,n)),1,function(x) point2points.distances(x,matrix(1:(2*271),ncol=2)))) ) user system elapsed 3.038 0.021 3.050


gqlNU/publicWW documentation built on Oct. 15, 2022, 1:17 a.m.