adjacency.matrix: Return an adjacency matrix for a square lattice.

Description Usage Arguments Details Value

View source: R/misc.R

Description

Return an adjacency matrix for a square lattice.

Usage

1

Arguments

m

the number of rows in the lattice.

n

the number of columns in the lattice. Defaults to NULL. If missing, the lattice is assumed to be m by m.

Details

This function builds the adjacency matrix for the m by n square lattice.

Value

A matrix A of 0s and 1s, where A_{ij} is equal to 1 iff vertices i and j are adjacent.


ngspatial documentation built on July 2, 2020, 12:01 a.m.