## A set of reference points:
x <- cbind(c(1,4,5,2,8,4), c(3,6,7,1,3,2))
dimnames(x) <- list(LETTERS[1:6], c("x", "y"))
## The pairwise Euclidean distances among the reference points:
d1 <- Euclid(x)
d1
## That result is the same as that obtained from function dist:
d2 <- dist(x, method = "euclidean")
all(d1 == d2)
## A second set of points:
y <- cbind(c(3,5,7), c(3,6,8))
dimnames(y) <- list(LETTERS[7:9], c("x", "y"))
## The distances between the points in y (rows) and x (columns):
Euclid(x, y)
Run the code above in your browser using DataLab