Compute mst and returns as a nb object

mst.nb(dxy)

Arguments

dxy

A distance matrix based on spatial coordinates of samples

Value

An object of class nb

See also

Author

Stéphane Dray stephane.dray@univ-lyon1.fr

Examples


xy <- matrix(rnorm(60),30,2)
dxy <- dist(xy)
th <- give.thresh(dxy)
nb1 <- mst.nb(dxy)
nb1
#> Neighbour list object:
#> Number of regions: 30 
#> Number of nonzero links: 58 
#> Percentage nonzero weights: 6.444444 
#> Average number of links: 1.933333 
wh1 <- which(as.matrix(dxy)==th,arr.ind=TRUE)
plot(nb1,xy,pch=20,cex=2,lty=3)
lines(xy[wh1[1,],1],xy[wh1[1,],2],lwd=2)
title(main="Maximum distance of the minimum spanning tree in bold")