include_self: Includes self in neighbor list

View source: R/utils-self.R

include_selfR Documentation

Includes self in neighbor list

Description

Includes observed region in list of own neighbors. For some neighbor lists, it is important to include the ith observation (or self) in the neighbors list, particularly for kernel weights.

Usage

include_self(nb)

remove_self(nb)

Arguments

nb

an object of class nb e.g. made by st_contiguity()

Value

An object of class nb.

Examples

nb <- st_contiguity(guerry)
self_included <- include_self(nb)
self_included
remove_self(self_included)

JosiahParry/sfdep documentation built on Sept. 7, 2024, 6:15 a.m.