Learn R Programming

SDPDmod (version 0.0.6)

SharedBMat: Shared boundary matrix

Description

This function calculates the shared boundary matrix

Usage

SharedBMat(sf_pol, rn = FALSE)

Value

W

spatial weights matrix (length of shared boundary between spatial units)

Arguments

sf_pol

spatial polygons, spatial lines object or spatial data frame

rn

logical, default FALSE. If TRUE, the spatial weights matrix is row-normalized

Author

Rozeta Simonovska

Examples

Run this code
library("sf")
# \donttest{
ger   <- st_read(system.file("shape/GermanyNUTS3.shp",
                             package = "SDPDmod"),
                 quiet = TRUE)
bav <- ger[which(substr(ger$NUTS_CODE,1,3)=="DE2"),] ## Bavarian districts
W     <- SharedBMat(bav)
# }

Run the code above in your browser using DataLab