Learn R Programming

rgeoda (version 0.1.0)

queen_weights: Queen Contiguity Spatial Weights

Description

Create a Queen contiguity weights with options of "order", "include lower order" and "precision threshold"

Usage

queen_weights(
  sf_obj,
  order = 1,
  include_lower_order = FALSE,
  precision_threshold = 0
)

Value

An instance of Weight-class

Arguments

sf_obj

An sf (simple feature) object

order

(Optional) Order of contiguity

include_lower_order

(Optional) Whether or not the lower order neighbors should be included in the weights structure

precision_threshold

(Optional) The precision of the underlying shape file is insufficient to allow for an exact match of coordinates to determine which polygons are neighbors

Examples

Run this code
library(sf)
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
queen_w <- queen_weights(guerry)
summary(queen_w)

Run the code above in your browser using DataLab