Your problem is that you have to use the shp and use it to create the
matrix.
if you need to read the shape file, probably use.
SHPFILE= readShapePoly(filename, IDvar)
you can use also readOGR from rgdal.
then use poly2nb this way.
nb.polyWV=poly2nb(SHPFILE)
the SHPFILE are in yellow because are the same.
then you convert your nb to a listw  and use it.
WVlistw=nb2listw(nb.polyWV, style="W")
I used style W for row standardization.
Hope this helps
Juan.

On Wed, Jun 20, 2012 at 6:17 PM, Saima Bashir <saimabashir11@yahoo.com>wrote:

> I want to built Spatial Weight Matrix for West Virginia only. I have
> downloaded shape file from US census wesite then imported into R. I was
> doing following steps:
>
> i. read.shape("C:\\Users\\sbashir\\Desktop\\R\\fe_2007_54.shp")
>
> ii. Creat neighbors list
>
> Wnbq <- cell2nb(6, 6, type = "queen")
>
> summary(Wnbq)
>
> iii. Spatial Weights
>
> nb2listw(neighbours = Wnbr, glist=NULL, style="W", zero.policy=NULL)
>
> I am confused about next step. I will really appreciate if someone can
> help me.
>
> Thanks
>
> Saima
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Juan Tomás Sayago Gómez
Graduate Research Assistant
West Virginia University - RRI
886 Chestnut Ridge Road, Room 520
P.O. Box 6825
Morgantown, WV 26506-6825

	[[alternative HTML version deleted]]

