## define vertex coordinate
x <- y <- seq(0, 1, length=30)
xy <- expand.grid(x=x, y=y)
## weighted adjacency matrix by Gaussian kernel
## for connecting vertices within distance 0.04
A1 <- adjmatrix(xy, method = "dist", 0.04)
## weighted adjacency matrix by Gaussian kernel
## for connecting seven neighboring vertices
A2 <- adjmatrix(xy, method="neighbor", 7)
Run the code above in your browser using DataLab