geocs_vector {geocomplexity} | R Documentation |
geocomplexity for spatial vector data based on geographical similarity
Description
This function calculates geocomplexity for in spatial vector data based on geographical similarity.
Usage
geocs_vector(
sfj,
wt = NULL,
method = "spvar",
similarity = 1,
normalize = TRUE,
returnsf = TRUE
)
Arguments
sfj |
An |
wt |
(optional) Spatial weight matrix. Must be a |
method |
(optional) When |
similarity |
(optional) When |
normalize |
(optional) Whether to further normalizes the calculated geocomplexity.
Default is |
returnsf |
(optional) When |
Value
A tibble
(returnsf
is FALSE
) or an sf
object (returnsf
is TRUE
)
Examples
econineq = sf::read_sf(system.file('extdata/econineq.gpkg',package = 'geocomplexity'))
gc = geocs_vector(dplyr::select(econineq,-Gini))
gc
library(ggplot2)
library(viridis)
ggplot(gc) +
geom_sf(aes(fill = GC)) +
scale_fill_viridis(option = "mako", direction = -1) +
theme_bw()