nb_union: Set Operations

View source: R/utils-set-operations.R

nb_unionR Documentation

Set Operations

Description

Perform set operations element-wise on two lists of equal length.

Usage

nb_union(x, y)

nb_intersect(x, y)

nb_setdiff(x, y)

Arguments

x

list of class nb

y

list of class nb

Details

  • nb_union() returns the union of elements in each element of x and y

  • nb_intersect() returns the intersection of elements in each element of x and y

  • nb_setdiff() returns the intersection of elements in each element of x and y

Value

A list of class nb

Examples

nb <- st_contiguity(guerry$geometry)
nb_knn <- st_knn(guerry$geometry, k = 3)
nb_setdiff(nb, nb_knn)
nb_union(nb, nb_knn)
nb_intersect(nb, nb_knn)


sfdep documentation built on Jan. 11, 2023, 9:08 a.m.