Learn R Programming

sfdep (version 0.2.5)

st_cardinalties: 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)

Value

an integer vector with the same length as nb.

Arguments

nb

A neighbor list object as created by st_neighbors().

See Also

Other other: st_nb_lag(), st_nb_lag_cumul()

Examples

Run this code
nb <- st_contiguity(sf::st_geometry(guerry))
st_cardinalties(nb)

Run the code above in your browser using DataLab