create_1D_mapper_object {mappeR} | R Documentation |
Run 1D mapper
Description
Run mapper using a one-dimensional filter, a cover of intervals, and a clustering algorithm.
Usage
create_1D_mapper_object(
data,
dists,
filtered_data,
cover,
clustering_method = "single",
global_clustering = TRUE
)
Arguments
data |
A data frame. |
dists |
A distance matrix for the data frame. |
filtered_data |
The result of a function applied to the data frame; there should be one filter value per observation in the original data frame. |
cover |
A 2D array of interval left and right endpoints; rows should be intervals and columns left and right endpoints (in that order). |
clustering_method |
A string to pass to hclust to determine clustering method. |
global_clustering |
Whether you want clustering to happen in a global (all level visible) or local (only current level set visible) context. |
Value
A list of two data frames, one with node data containing bin membership, data points per cluster, and cluster dispersion, and one with edge data containing sources, targets, and weights representing overlap strength.
Examples
data = data.frame(x = sapply(1:100, function(x) cos(x)), y = sapply(1:100, function(x) sin(x)))
projx = data$x
num_bins = 10
percent_overlap = 25
cover = create_width_balanced_cover(min(projx), max(projx), num_bins, percent_overlap)
create_1D_mapper_object(data, dist(data), projx, cover, "single")