Skip to content
Prev 11269 / 29559 Next

spdep: show neighbors from "dnearneigh"

On Tue, 22 Mar 2011, Mathieu Rajerison wrote:

            
No, the question was how to convert to a two-column from-to 
representation, and a direct route is:

example(read.gal)
# to get an nb object
us48.q
us48.q[1:2]
res <- listw2sn(nb2listw(us48.q))[,1:2]
res[1:9,]
str(res)

If you need a matrix, do as.matrix(res).

Roger