geocd_vector {geocomplexity}R Documentation

geocomplexity for spatial vector data based on spatial dependence

Description

This function calculates geocomplexity for spatial vector data based on spatial dependence.

Usage

geocd_vector(
  sfj,
  wt = NULL,
  method = "moran",
  normalize = TRUE,
  returnsf = TRUE
)

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. Must be a matrix class.

method

(optional) In instances where the method is moran, geocomplexity is determined using local moran measure method. Conversely, when the method is spvar, the spatial variance of attribute data serves to characterize geocomplexity. For all other methods, the shannon information entropy of attribute data is employed to represent geocomplexity. The selection of the method can be made from any one of the three options: moran, spvar or entropy. Default is moran.

normalize

(optional) Whether to further normalizes the calculated geocomplexity. Default is TRUE.

returnsf

(optional) When returnsf is TRUE, return an sf object, otherwise a tibble. Default is TRUE.

Value

A tibble (returnsf is FALSE) or an sf object (returnsf is TRUE)

Note

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.

Examples

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()


[Package geocomplexity version 0.2.1 Index]