[R-sig-Geo] creating an adjacency matrix in spdep

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 31 09:29:37 CET 2011


On Sun, 30 Jan 2011, Stratford, Jeffrey wrote:

> Hi everyone,
>
>
>
> Is it possible to create an adjacency matrix required for
> WinBUGS/GeoBUGS in spdep from a csv file containing UTM coordinates?
>
>
>
> I've gone through the spdep documentation and it looks like the
> equivalent there is col.gal.nb?  Is that right?  I see where that object
> is used but not how it was created.
>

There is plenty of documentation in spdep on the creation of nb objects if 
you look for it. For point support (your case), you can choose between 
dnearneigh() for distance-based neighbours, knn2nb(knearneigh()) for k 
nearest neighbours (will need making summetric with make.sym.nb() for 
WinBUGS), or the various graph2nb() variants (which may also need making 
symmetric). The case you refer to from ?nb2WB refers to ?columbus, which 
explains that col.gal.nb is an nb object imported from an original 
GAL-format file for compatibility with GeoDa - the example shows how, 
using read.gal(). You should also be able to read the *.gal or *.gwt files 
you made in GeoDa with read.gal() or read.gwt2nb(), then out again with 
nb2WB().

Hope this helps,

Roger

>
>
> I also realize that I can get the same through GeoDa but I haven't been
> able to figure out how to export the adj matrix from there.
>
>
>
> Many thanks,
>
>
>
> Jeff
>
>
>
> *****************************************
>
> Jeffrey A. Stratford, Ph.D.
>
> Department of Health and Biological Sciences
>
> 84 W. South St.
>
> Wilkes Univertsity, PA 18766
>
> 570-332-2942
>
> http://web.wilkes.edu/jeffrey.stratford/
>
> *****************************************
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list