Description Usage Arguments Value Examples
View source: R/scale-neighborhood-size.R
scales the number of neighbors (neighbourhood size) depending on the local sample density. keeps increasing K until the distance to the furthest of the K neighbors is above the dmin threshold
1 | scale_S_neib(input_dat, n, K_init, Dist, dmin)
|
input_dat: |
data frame of input data with rows=samles and cols=dimensions |
n: |
position (row) of the sample, in the input_dat data frame |
K_init: |
initial number of nearest neighbors that needs to be scaled |
Dist: |
distance matrix of all samples |
dmin: |
distance threshold (to the furthest neighbor) to be reached |
Kscaled: the scaled neighbourhood size
1 2 3 4 5 | data(scdata.3lines.simulated6genes)
Dist <- compute_all_distances(scdata.3lines.simulated6genes)
#find the 5 nearest neighbours of the second sample
neibs <- find_K_nearest(n = 2, K = 5, Dist = Dist)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.