Dear list,
 
I would like to plot the links that dnearneigh() identifies.
 
Space <- matrix(data = 1, nrow = 10, ncol = 10)
Space[1,] <- NA
Space[nrow(Space),] <- NA
Space[,1] <- NA
Space[,ncol(Space)] <- NA
WaterRow <- row(Space)
WaterCol <- col(Space)
WaterXY  <- cbind(X=WaterRow[Space==1], Y=WaterCol[Space==1])
library(spdep)
WaterXY  <- na.omit(WaterXY)
WaterNB  <- dnearneigh(WaterXY, 0, 1) 
res <- listw2sn(nb2listw(WaterNB))[,1:2]
as.matrix(res)
 
I have found an older post on a related topic that shows an example of what I would like to do:
 
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)

I have managed to retrieve the links using as.matrix(res), but I can't get the plot of nodes and links to appear. 
 
Could someone help out ?
 
Thank you very much in advance,
 
Juliane 
	[[alternative HTML version deleted]]

