Learn R Programming

gmum.r (version 0.2.1)

findClosests: findClosests

Description

Finds closest node from given list to vector. Often used together with calculateCentroids

Usage

findClosests(object, node.ids, x)

Arguments

object
GNG object
node.ids
List of indexes of nodes in gng.
x
Can be either vector or data.frame.

Details

Find closest node

Examples

Run this code
## Not run: 
# gng <- GNG(gng.preset.sphere(100))
# # Find closest centroid to c(1,1,1)
# found.centroids <- calculateCentroids(gng)
# findClosests(gng, found.centroids, c(1,1,1))
# ## End(Not run)

Run the code above in your browser using DataLab