edgeBetweenClust | R Documentation |
edgeBetweenClust
is a utility function which takes in a graph and the membership vector
mapping each vertex to a certain cluster and returns a vector of boolean values. A value of 'TRUE'
means that the corresponding edge in that edge list position connects vertices which belong to
distinct clusters. A value of 'FALSE' means that the edge connects vertices which belong to the same
cluster.
edgeBetweenClust(graph, membership)
graph |
An object of class 'graph' from the |
membership |
A vector of integers of length N (see |
A vector of boolean values of length ecount(graph)
where each TRUE value represents an edge that connects distinct clusters
Luo, Z.T. (*), Sang, H. and Mallick, B.K. (2021), BAST: Bayesian Additive Regression Spanning Trees for Complex Constrained Domain
Luo, Z.T. (*), Sang, H. and Mallick, B.K. (2021), A Bayesian Contiguous Partitioning Method for Learning Clustered Latent Variables, Journal of Machine Learning Research, 22, 1-52.
set.seed(1)
coords = data.frame(lon = rnorm(50), lat = rnorm(50))
g = constructGraph(coords, 5)
clust_membership = constructClusters(g, 6, minclust = 5)$membership
betweenness = edgeBetweenClust(g, clust_membership)
plot(g,
layout = as.matrix(coords),
edge.color = as.numeric(betweenness) + 1,
edge.arrow.mode = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.