st_cardinalties: Calculate neighbor cardinalities

View source: R/cardinality.R

st_cardinaltiesR Documentation

Calculate neighbor cardinalities

Description

Identify the cardinality of a neighbor object. Utilizes spdep::card() for objects with class nb, otherwise returns lengths(nb).

Usage

st_cardinalties(nb)

Arguments

nb

A neighbor list object as created by st_neighbors().

Value

an integer vector with the same length as nb.

See Also

Other other: st_nb_lag_cumul(), st_nb_lag()

Examples

nb <- st_contiguity(sf::st_geometry(guerry))
st_cardinalties(nb)

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