getAdj_auto: Calculate adjacency matrix by automatically choosing radius

View source: R/main.R

getAdj_autoR Documentation

Calculate adjacency matrix by automatically choosing radius

Description

an efficient function to find the radius by bi-section method , then find neighbors based on the matrix of position, which ensures that each spot has approximately lower.med~upper.med neighbors in the sense of median.

Usage

getAdj_auto(pos, lower.med=4, upper.med=6, radius.upper= NULL)

Arguments

pos

a n-by-2 matrix of position.

lower.med

an integer, the lower bound of median number of neighbors among all spots.

upper.med

an integer, the upper bound of median number of neighbors among all spots.

radius.upper

a real, the upper bound of radius, default as NULL. If radius.upper= NULL, the upper bound is automatically determined by algorithm.

Value

A sparse adjacency matrix containing the neighbourhood.

See Also

getAdj, getAdj_manual.


feiyoung/DR.SC documentation built on March 23, 2024, 6:31 p.m.