View source: R/baskin_robbins.R
create_ball_mapper_object | R Documentation |
Run Mapper using the identity function as a lens and an \varepsilon
-net cover, greedily generated using a distance matrix.
create_ball_mapper_object(data, dists, eps)
data |
A data frame. |
dists |
A distance matrix for the data frame. Can be a |
eps |
A positive real number for the desired ball radius. |
A list
of two data frames, nodes
and edges
, which contain information about the Mapper graph constructed from the given parameters.
The node data frame consists of:
id
: vertex ID
cluster_size
: number of data points in vertex
mean_dist_to_medoid
: mean distance to medoid of vertex
data
: names of data points in cluster
The edge
data frame contains consists of:
source
: vertex ID of edge source
target
: vertex ID of edge target
weight
: Jaccard index of edge; this is the size of the intersection between the vertices divided by the union
overlap_data
: names of data points in overlap
overlap_size
: number of data points overlap
# Create noisy cirle data set
data = data.frame(x = sapply(1:100, function(x) cos(x)), y = sapply(1:100, function(x) sin(x)))
# Set ball radius
eps = .5
# Create Mapper object
create_ball_mapper_object(data, dist(data), eps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.