find_K_nearest: Find K nearest neighbours

Description Usage Arguments Value Examples

View source: R/find-k-nearest.R

Description

Finds the K nearest neighbours of a sample, given a matrix containing sample distances.

Usage

1
find_K_nearest(n, K = 3, Dist)

Arguments

n:

sample for which the nearest neighbors are computed

K:

number of nearest neighbors to be considered

Dist:

matrix containing sample distances, initially computed by compute_all_distances

Value

a list with elements:

Examples

1
2
3
4
Dist <- compute_all_distances(scdata.3lines.simulated6genes_subsampled)

#find the 5 nearest neghbours of the second sample
neibs <- find_K_nearest(n=2, K = 5, Dist = Dist)

theislab/kbranches documentation built on Feb. 27, 2020, 11:01 a.m.