farthest_points: Find the farthest points

Description Usage Arguments Details Value See Also Examples

View source: R/sampling.R

Description

Select a subset of points that maximize the smallest pairwise distance between the points.

Usage

1

Arguments

data

A matrix of points to choose n from, either in two or three dimensions.

n

The number of points to select.

Details

This function begins with a random sample of n points and iterately puts them back into the mother set and tries to see if there is a better candidate than the point that was put back.

Value

A vector of indices for the points in the subset.

See Also

dist

Examples

1
2
3
4
5
6
xy <- matrix(runif(200), ncol = 2)
id <- farthest_points(data = xy, n = 5)
xy[id, ]

plot(xy)
points(xy[id, ], pch = 16)

jolars/euclidr documentation built on May 19, 2019, 7:25 p.m.