knn_graph_from_dist: Build kNN graph from distance (used in '"build_knn_graph"')

View source: R/build_knn_graph.R

knn_graph_from_distR Documentation

Build kNN graph from distance (used in "build_knn_graph")

Description

Build kNN graph from distance (used in "build_knn_graph")

Usage

knn_graph_from_dist(D, k = 5, return_neighbors_order = TRUE, mode = "all")

Arguments

D

dist matrix or dist object (preferentially)

k

kNN parameter

return_neighbors_order

whether return order of neighbors (not available for nn2 option)

mode

mode of graph_from_adj_list ('all' – undirected graph, 'out' – directed graph)

Value

a list with components

  • graph.knn - igraph object

  • order - Nxk matrix with indices of k nearest neighbors ordered by relevance (from 1st to k-th)


SuperCell documentation built on Oct. 25, 2024, 5:07 p.m.