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

Examples

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

sfdep documentation built on Sept. 13, 2024, 5:07 p.m.