Learn R Programming

trafficCAR (version 0.1.0)

components_from_adjacency: Connected components and isolates from an adjacency matrix

Description

Computes connected component membership (1..K) and isolates (degree 0) from an undirected adjacency matrix. Intended for ICAR centering per component.

Usage

components_from_adjacency(A)

Value

A list with:

components

Integer vector of length n giving component id (1..K).

isolates

Logical vector of length n, TRUE if degree 0.

Arguments

A

Square adjacency matrix (base matrix or `Matrix` sparse).