On Wed, 17 Jul 2019, Stuart Reece wrote:

Hi,

I was wanting to include a listw list of neighbours for USA states which
include Alaska and Hawaii with Alaska a neighbour for Washington and Oregon
states and Hawaii a neighbour for California and the Western continental US
states.

Naturally queen relationships fail.

The Albers shapefiles at this URL are really useful for general mapping
purposes but result in erroneous relationships with k-nearest neighbours
when this is performed in GeoDa.



These maps have Hawaii and Alaska elided to south of Texas.



<https://github.com/hrbrmstr/albersusa>
https://github.com/hrbrmstr/albersusa



They are troublesome to install, accessing just the file is impossible.

Did you look at the documentation of spdep::edit.nb()? Reading the list of functions and methods in a package tends to be helpful. Use spdep::make.sym.nb() after storing the output of edit.nb(). Because edit.nb() is interactive, I can't provide a script. The next release of spdep will support displaying sf polygons, for now you'd need to use:

usa <- usa_sf("aeqd")
nb <- spdep::poly2nb(usa)
crds <- st_coordinates(st_centroid(usa, of_largest_polygon=TRUE))
nb1 <- spdep::edit.nb(nb, crds, as(usa, "Spatial"))
nb2 <- spdep::make.sym.nb(nb1)

or similar.

Hope this clarifies,

Roger


When one uses the native map - with unelided states - available from the URL
below - then k-nearest neighbours also does not work properly in GeoDa.



I also want to extend this to the SAMHSA substate shapefile found at this
URL for the 395 substate areas used by the USA National Survey of Drug Use
and Health within SAMHSA.




<https://www.samhsa.gov/data/report/2014-2016-nsduh-substate-region-shapefil
e>
https://www.samhsa.gov/data/report/2014-2016-nsduh-substate-region-shapefile




I did see that someone was able to create relationships across a straight
for Italy although I am not quite sure how this was accomplished
technically.



I would be grateful for any help you could provide.



Thankyou so much,



Stuart Reece.





               [[alternative HTML version deleted]]



_______________________________________________

R-sig-Geo mailing list

<mailto:R-sig-Geo@r-project.org> R-sig-Geo@r-project.org

<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to