Counts the number of neighbors a given cell has within a specified radius, useful for assessing habitat connectivity.

countNeighborsOLD(cell, cells, radius)

Arguments

cell

The cell for which to count neighbors.

cells

The matrix of cells to check against.

radius

The radius within which to count neighbors.

Value

The count of neighbors within the specified radius.