Description Usage Arguments Value Author(s) See Also Examples
The function converts a knn
object returned by knearneigh
into a neighbours list of class nb
with a list of integer vectors
containing neighbour region number ids.
1 |
knn |
A knn object returned by |
row.names |
character vector of region ids to be added to the neighbours list as attribute |
sym |
force the output neighbours list to symmetry |
The function returns an object of class nb
with a list of integer vectors containing neighbour region number ids. See card
for details of “nb” objects.
Roger Bivand Roger.Bivand@nhh.no
1 2 3 4 5 6 |
Loading required package: sp
Loading required package: Matrix
colmbs> require(maptools)
Loading required package: maptools
Checking rgeos availability: TRUE
colmbs> columbus <- readShapePoly(system.file("etc/shapes/columbus.shp",
colmbs+ package="spdep")[1])
colmbs> col.gal.nb <- read.gal(system.file("etc/weights/columbus.gal",
colmbs+ package="spdep")[1])
Warning message:
use rgdal::readOGR or sf::st_read
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.