Construct a neighbour list from grid coordinates.
Arguments
- spe
A SpatialExperiment object.
- n
Integer. Search for neighbours within (...). Either the number of neighbors or radius
- radius
Numeric. Search for neighbours within the radius.
- diagonal
Whether to consider diagonal connection if using square grid
- dist_func
Options for distance-based weight. "idw" for inverse distance, "exp" for exponential decay, "binary" for constant weight, and "raw" for raw distance.
- dist_type
Options of using euclidean or manhattan for distance calculation
- standardisation
Options for weight standardisation. "none" for nothing, and "row" for dividing weights by number of neighbours.
- scale
Numeric scaler for weight scaling.
- nbrs_name
Name of the neighbour list to be stored. Default to be "grid".
- cpu_threads
Number of cpu threads for parallel computation.
Examples
data("xenium_bc_spe")
spe <- gridDensity(spe)
spe <- findNbrsGrid(spe,n=3)