# NOT RUN {
##First create some random locations
x <- rnorm(5)
y <- rnorm(5)
##compute distance matrix
D <- crossDist( cbind(x,y) )
##or distance between different locations
X <- matrix(rnorm(6),3,2)
Y <- rbind(X, matrix(rnorm(8),4,2))
Dcross <- crossDist(X, Y)
##or distances between coordinates in R3
C1 <- matrix(rnorm(9),3,3)
C2 <- matrix(rnorm(12),4,3)
Dcross.R3 <- crossDist(C1, C2)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab