Description Usage Arguments Value Examples
Return the refth row of the matrix
1 |
X |
Coordinates data.frame |
distance matrix
1 2 3 4 5 6 7 8 9 10 11 12 | N <- 36
X <- as.matrix(expand.grid(1:sqrt(N),1:sqrt(N)))
distRef(X,ref = 4,tb = rep(0,2),tore = TRUE,toreBound = sqrt(N))
set.seed(1)
X <- as.matrix(cbind(runif(N, min = 1,max = 3),runif(N,min = 1,max = 3)))
ref <- which.min(X[,2])
d1 <- distRef(X,ref,tb = rep(0,2),tore = TRUE,toreBound = 3)
d2 <- distRef(X,ref,tb = rep(0,2),tore = FALSE,toreBound = 0)
plot(X)
points(X[which(abs(d1- d2) > 1e-7),],pch = 16)
points(X[which(d2 < 1),],pch = 16,col = "red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.