Skip to contents

constructing spatial weight matrix based on geocomplexity with spatial dependence

Usage

geocd_swm(sfj, wt = NULL, style = "B", ...)

Arguments

sfj

An sf object or spatial vector object that can be converted to sf by sf::st_as_sf().

wt

(optional) Spatial weight matrix based on spatial adjacency or spatial distance relationships.

style

(optional) A character that can be B,W,C. More to see spdep::nb2mat(). Default is B.

...

(optional) Other parameters passed to geocomplexity::geocd_vector().

Value

A matrix

Examples

econineq = sf::read_sf(system.file('extdata/econineq.gpkg',package = 'geocomplexity'))
wt_gc = geocd_swm(econineq)
wt_gc[1:5,1:5]
#>           [,1]      [,2]      [,3]      [,4]      [,5]
#> [1,] 0.0000000 0.5050696 0.4544196 0.5640641 0.5800917
#> [2,] 0.4990206 0.0000000 0.8393764 0.0000000 0.0000000
#> [3,] 0.4314267 0.8366975 0.0000000 0.0000000 0.0000000
#> [4,] 0.5440211 0.0000000 0.0000000 0.0000000 0.9429423
#> [5,] 0.5713514 0.0000000 0.0000000 0.9402259 0.0000000