getAdj_fixedNumber: Calculate adjacency matrix by user-specified number of...

View source: R/main.R

getAdj_fixedNumberR Documentation

Calculate adjacency matrix by user-specified number of neighbors

Description

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

Usage

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.


PRECAST documentation built on May 29, 2024, 3 a.m.