View source: R/prep_unlabeled_graph.R
| prep_unlabeled_graph | R Documentation |
Presently,
cluster_degree_betweenness() function only works with labeled graphs. prep_unlabeled_graph() is a utility function that gives an unlabeled graph labels which are string values of their vertices.
prep_unlabeled_graph(graph)
graph |
an unlabeled graph. |
An "igraph" object with named vertices.
cluster_degree_betweenness() which this function aids.
library(igraph)
library(igraphdata)
library(ig.degree.betweenness)
data("UKfaculty")
# Making graph undirected so it looks nicer when its plotted
uk_faculty <- prep_unlabeled_graph(UKfaculty) |>
as.undirected()
ndb <- cluster_degree_betweenness(uk_faculty)
plot(
ndb,
uk_faculty,
main= "Node Degree Clustering"
)
ndb
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.