knnVec: knnVec

View source: R/nearestNeighbors.R

knnVecR Documentation

knnVec

Description

Number of neighbors for each sample (vector) from a neighbor-pair matrix.

Usage

knnVec(neighbor.pairs.mat)

Arguments

neighbor.pairs.mat

two columns of redundant "i,j" pairs from nearestNeighbors function

Value

knn.vec vector number of nearest neighbors for each instance

Examples

neighbor.pairs.idx <- nearestNeighbors(
  predictors.mat,
  nbd.method = "multisurf",
  nbd.metric = "manhattan",
  sd.frac = 0.5
)
mean(knnVec(neighbor.pairs.idx)) # average number of neighbors

insilico/npdr documentation built on July 6, 2023, 1:14 p.m.