Description Usage Arguments Value Author(s) References See Also Examples
View source: R/mapperVertices.R
The input to this function is a TDAmapper class object and the output is a data frame of vertices that can be used as input to the networkD3 plot utility.
1 | mapperVertices(m, pt_labels)
|
m |
An object of class TDAmapper that is the output of the mapper function. |
A data frame describing the vertices in the graph of the mapper output and the point labels that will be displayed when the mouse hovers over a vertex in the graph.
Paul Pearson, pearsonp@hope.edu
https://github.com/paultpearson/TDAmapper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
X <- data.frame( x=2*cos(0.5*(1:100)), y=sin(1:100) )
f <- X$y
m1 <- mapper(
distance_matrix = dist(X),
filter_values = f,
num_intervals = 10,
percent_overlap = 50,
num_bins_when_clustering = 10)
pt_labels <- 1:length(f)
vertices <- mapperVertices(m1, pt_labels)
edges <- mapperEdges(m1)
# interactive plot
forceNetwork(Nodes = nodes, Links = links,
Source = "Linksource", Target = "Linktarget",
Value = "Linkvalue", NodeID = "Nodename",
Group = "Nodegroup", opacity = 0.8,
linkDistance = 10, charge = -400)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.