[R-sig-Geo] help

Andrew Duff andrewaduff at gmail.com
Thu Apr 5 15:00:29 CEST 2018


Shouldn't this line be

xlist <- nb2listw(neighbours,glist = NULL,style = "W",zero.policy =TRUE)


instead of


xlist <- nb2listw(neighbours,glist = NULL,style = "W",zero.policy =TRU)

?



On Wed, Apr 4, 2018 at 9:44 PM, Yalemzewod Gelaw <yalassefa at gmail.com>
wrote:

> I am a new student to R learning for spatial analysis. I was hoping
> someone could help me with the
> error message I keep getting when I try to convert the neighbour data to a
> listw object use the nb2listw()  function.
>
> plot(xw_nbq, coords,add=TRUE,col="red")> summary(xw_nbq)
>
>
> Neighbour list object:
> Number of regions: 140
> Number of nonzero links: 680
> Percentage nonzero weights: 3.469388
> Average number of links: 4.857143
> 2 regions with no links:
> 3 138
> Link number distribution:
>
>  0  1  2  3  4  5  6  7  8  9
>  2  6  4 16 32 35 17 13 13  2
> 6 least connected regions:
> 11 32 57 117 124 137 with 1 link
> 2 most connected regions:
> 28 71 with 9 links
>
> ​when I try to run nb2listw, i got repated error following the below error
> message. ​
>
> xlist <- nb2listw(neighbours,glist = NULL,style = "W",zero.policy =TRU) > summary.listw(xlist)
> Error in summary.listw(xlist) : regions with no neighbours found, use
> zero.policy=TRUE
>
> I wonder if someone advises me how to fix the error message from my
> working directory
>>
>
> *Regards, *
>
> Yalem
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list