create_balls | R Documentation |
Make a cover of balls
create_balls(data, dists, eps)
data |
A data frame. |
dists |
A distance matrix for the data frame. |
eps |
A positive real number. |
A list of vectors of data point names, one list element per ball. The output is such that every data point is contained in a ball of radius \varepsilon
, and no ball center is contained in more than one ball. The centers are datapoints themselves.
num_points = 5000
P.data = data.frame(
x = sapply(1:num_points, function(x)
sin(x) * 10) + rnorm(num_points, 0, 0.1),
y = sapply(1:num_points, function(x)
cos(x) ^ 2 * sin(x) * 10) + rnorm(num_points, 0, 0.1),
z = sapply(1:num_points, function(x)
10 * sin(x) ^ 2 * cos(x)) + rnorm(num_points, 0, 0.1)
)
P.dist = dist(P.data)
balls = create_balls(data = P.data, dists = P.dist, eps = .25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.