Hi, R users,

I am estimating a spatial lag model using the "spdep" package. Before
running the model, I was creating K nearest neighbours for spatial weights.
My observations are points.

Let me use the "coords" in Columbus dataset as an example, and I consider 5
nearest neighbors.

library(spdep)
data(columbus)
### create neighbor list using point coordinates "coords"
col_nb5<-knn2nb(knearneigh(coords,k=5,longlat=FALSE,RANN=TRUE))
### calculate weighting
col_wts<-nb2listw(col_nb5, style="W",zero.policy=FALSE)

### now I want to see the neighborhood list: col_nb5

print(col_nb5)

### instead of a neighbor list, what I get is:

Neighbour list object:
Number of regions: 49
Number of nonzero links: 245
Percentage nonzero weights: 10.20408
Average number of links: 5
Non-symmetric neighbours list

I had similar problem when trying to view "col_wts"

My question is: what is the right way to view the neighbor list?

Thanks!

Gary

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to