aggregate_knn: Aggregate point-wise distances over k nearest neighbors

Description Usage Arguments Value Examples

Description

Aggregate point-wise distances over k nearest neighbors

Usage

1

Arguments

data

A numeric matrix, data frame or distance matrix

fun

A function to aggregate point-wise distances

k

An integer specifying number of nearest neighbors used to compute aggregation

Value

A numeric vector

Examples

1
2
aggregate_knn(iris[, -5], mean, 3) # average 3-nn
aggregate_knn(dist(iris[, -5]), max, 5) # equivalent to exact 5-nn

dannymorris/outsiders documentation built on May 13, 2019, 1:22 p.m.