Learn R Programming

geostan (version 0.8.1)

n_nbs: Count neighbors in a connectivity matrix

Description

Count neighbors in a connectivity matrix

Usage

n_nbs(C)

Value

A vector with the number of non-zero values in each row of C

Arguments

C

A connectivity matrix

Examples

Run this code

data(sentencing)
C <- shape2mat(sentencing)
sentencing$Ni <- n_nbs(C)

Run the code above in your browser using DataLab