an efficient function to find the neighborhood based on the matrix of position and a user-specified number of neighbors of each spot.

getAdj_fixedNumber(pos, number=6)

Arguments

pos

is a n-by-d matrix of position, where n is the number of spots, and d is the dimension of coordinates.

number

is the number of neighbors of each spot. Euclidean distance to decide whether a spot is an neighborhood of another spot.

Value

A sparse matrix containing the neighbourhood.

See also

getAdj_auto, getAdj.