nb2Mat: Convert the 'nb-class' from spdep to a sparse Matrix

View source: R/utils.R

nb2MatR Documentation

Convert the nb-class from spdep to a sparse Matrix

Description

This function genereates a sparse Matrix from a neighborhood matrix. It bypasses spdep::nb2mat() which leads to a dense matrix representation.

Usage

nb2Mat(nb)

Arguments

nb

A nb-class from spdep

Value

A sparse matrix

Author(s)

Lukas Dargel

Examples

nb <- spdep::poly2nb(germany_grid)
nb2Mat(nb)

LukeCe/spflow documentation built on Nov. 11, 2023, 8:20 p.m.