geocd_vector {geocomplexity} | R Documentation |
This function calculates geocomplexity for spatial vector data based on spatial dependence.
geocd_vector(
sfj,
wt = NULL,
method = "moran",
normalize = TRUE,
returnsf = TRUE
)
sfj |
An |
wt |
(optional) Spatial weight matrix. Must be a |
method |
(optional) In instances where the method is |
normalize |
(optional) Whether to further normalizes the calculated geocomplexity.
Default is |
returnsf |
(optional) When |
A tibble
(returnsf
is FALSE
) or an sf
object (returnsf
is TRUE
)
If wt
is not provided, for polygon vector data, geocomplexity
will use a first-order queen
adjacency binary matrix; for point vector data, the six nearest points are used as adjacency
objects to generate an adjacency binary matrix.
econineq = sf::read_sf(system.file('extdata/econineq.gpkg',package = 'geocomplexity'))
gc = geocd_vector(econineq)
gc
library(ggplot2)
library(viridis)
ggplot(gc) +
geom_sf(aes(fill = GC_Gini)) +
scale_fill_viridis(option = "mako", direction = -1) +
theme_bw()