Molo <kurz_m <at> uni-hohenheim.de> writes:

> 
...
> *As there are some regions without neighbours in my data I use the following
> code to create the Weights Matrix:*
> 
> > W_Matrix<- nb2listw(location_nbq, style="W", zero.policy=TRUE)
> >W_Matrix
> 
> *And get this Output:*
> 
...
> /("Error in print.listw(list(style = "W", neighbours = list(c(23L, 31L, 42L
> : 
>   regions with no neighbours found, use zero.policy=TRUE")/
> 
> As I use "zero.policy=TRUE" I just don't understand what I'm doing wrong...
> My question would be: How could I create a Weights Matrix allowing for
> no-neighbour areas? 

You have not grasped the fact that your object W_Matrix has been created
correctly, but that spdep:::print.listw also needs a zero.policy=TRUE, so:

print(W_Matrix, zero.policy=TRUE)

will work. If you want to set this globally for all subsequent function
calls in your current session, use set.ZeroPolicyOption(TRUE).

Hope this clarifies,

Roger

PS. Consider posting questions of this kind to R-sig-geo

> 
> Thanks
> Michael

______________________________________________
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