find_neighbors: Compute pairwise distances between all spots and return list...

View source: R/utils.R

find_neighborsR Documentation

Compute pairwise distances between all spots and return list of neighbors for each spot.

Description

Compute pairwise distances between all spots and return list of neighbors for each spot.

Usage

find_neighbors(positions, radius, method = c("manhattan", "euclidean"))

Arguments

positions

(n x 2) matrix of spot coordinates.

radius

The maximum distance for two spots to be considered neighbors.

method

Distance metric to use.

Value

List df_j, where df_j[[i]] is a vector of zero-indexed neighbors of i.


edward130603/BayesSpace documentation built on May 11, 2023, 6:13 a.m.