Description Usage Arguments Value Author(s) See Also Examples
View source: R/weights-utils.R
The function includes the region itself in its own list of neighbours, and sets attribute "self.included" to TRUE.
1 | include.self(nb)
|
nb |
input neighbours list of class |
The function returns an object of class nb
with a list of integer vectors containing neighbour region number ids; attribute "self.included" is set to TRUE.
Roger Bivand Roger.Bivand@nhh.no
1 2 3 4 | example(columbus)
coords <- coordinates(columbus)
summary(col.gal.nb, coords)
summary(include.self(col.gal.nb), coords)
|
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
Neighbour list object:
Number of regions: 49
Number of nonzero links: 230
Percentage nonzero weights: 9.579342
Average number of links: 4.693878
Link number distribution:
2 3 4 5 6 7 8 9 10
7 7 13 4 9 6 1 1 1
7 least connected regions:
1 6 31 39 42 46 47 with 2 links
1 most connected region:
20 with 10 links
Summary of link distances:
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.1276 0.3613 0.4566 0.4694 0.5536 0.8924
The decimal point is 1 digit(s) to the left of the |
1 | 3344
1 | 99
2 | 000011333344
2 | 556677779999
3 | 000011222222223344444444
3 | 556666777777888888889999999999
4 | 00001111112233333333334444
4 | 55666666666666777777777788888899
5 | 0011112222222222222233334444
5 | 556666667788
6 | 000000112244
6 | 5577889999
7 | 11112244
7 | 557777
8 | 1144
8 | 55999999
Neighbour list object:
Number of regions: 49
Number of nonzero links: 279
Percentage nonzero weights: 11.62016
Average number of links: 5.693878
Link number distribution:
3 4 5 6 7 8 9 10 11
7 7 13 4 9 6 1 1 1
7 least connected regions:
1 6 31 39 42 46 47 with 3 links
1 most connected region:
20 with 11 links
Summary of link distances:
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.2576 0.4073 0.3870 0.5232 0.8924
The decimal point is 1 digit(s) to the left of the |
0 | 0000000000000000000000000000000000000000000000000
0 |
1 | 3344
1 | 99
2 | 000011333344
2 | 556677779999
3 | 000011222222223344444444
3 | 556666777777888888889999999999
4 | 00001111112233333333334444
4 | 55666666666666777777777788888899
5 | 0011112222222222222233334444
5 | 556666667788
6 | 000000112244
6 | 5577889999
7 | 11112244
7 | 557777
8 | 1144
8 | 55999999
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.