NNeighbors: Nearest Neighbors

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/1003-clusterJarvis-Patrick.R

Description

Nearest Neighbors

Usage

1
NNeighbors(x, numNbrs = NULL, cutoff = NULL, ...)

Arguments

x

Either an FPset or an APset.

numNbrs

Number of neighbors to find for each item. If not enough neighbors can be found the matrix will be padded with NA.

cutoff

The minimum similarity value an item must have to another item in order to be included in that items neighbor list. This parameter takes precedence over numNbrs. This parameter allows to obtain tighter clustering results.

...

These parameters will be passed into the distance function used

Details

Computes the nearest neighbors of descriptors in an FPset or APset object for use with the jarvisPatrick clustering function. Only one of numNbrs or cutoff should be given, cutoff will take precedence if both are given. If numNbrs is given, then that many neighbors will be returned for each item in the set. If cutoff is given, then, for each item X, every neighbor that has a similarity value greater than or equal to the cutoff will be returned in the neighbor list for X.

Value

The return value is a list with the following components:

Author(s)

Min-feng Zhu <wind2zhu@163.com>

See Also

See clusterJP for Jarvis-Patrick Clustering

Examples

1
2
3
data(sdfbcl)
apbcl = convSDFtoAP(sdfbcl)
nnm = NNeighbors(apbcl, cutoff = 0.5)

BioMedR documentation built on Nov. 17, 2017, 10:08 a.m.