mOrdNbr | R Documentation |
Finds the 1th to m-th order neighbors matrix.
mOrdNbr(sf_pol = NULL, m = 1, neigbs = NULL, listv = FALSE, rn = FALSE)
sf_pol |
spatial polygons object |
m |
the order of neighbors up to which they will be included in the weights matrix, default 1 |
neigbs |
neighbors list, default NULL |
listv |
logical, default FALSE. If TRUE the list of neighbors should also be returned |
rn |
logical, default FALSE. If TRUE, the weight matrix will be row-normalized |
W |
spatial weights matrix |
nlist |
list of neighbors |
Rozeta Simonovska
library("sf")
ger <- st_read(system.file("shape/GermanyNUTS3.shp",
package = "SDPDmod"))
m1thn <- mOrdNbr(ger)
m4thn <- mOrdNbr(ger, 4)
mat1 <- rownor(m4thn)
m4thn2<- mOrdNbr(ger, 4, listv = TRUE, rn = TRUE)
mat2 <- m4thn2$W
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.