mOrdNbr {SDPDmod} | R Documentation |
1st to m-th order neighbors matrix
Description
Finds the 1th to m-th order neighbors matrix.
Usage
mOrdNbr(sf_pol = NULL, m = 1, neigbs = NULL, listv = FALSE, rn = FALSE)
Arguments
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 |
Value
W |
spatial weights matrix |
nlist |
list of neighbors |
Author(s)
Rozeta Simonovska
Examples
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
[Package SDPDmod version 0.0.5 Index]