# Load data
wmt <- wmt2[,7:24]
# Estimate network
network <- EBICglasso.qgraph(data = wmt)
# Compute Edge Betweenness
community.detection(network, algorithm = "edge_betweenness")
# Compute Fast Greedy
community.detection(network, algorithm = "fast_greedy")
# Compute Fluid
community.detection(
network, algorithm = "fluid",
no.of.communities = 2 # needs to be set
)
# Compute Infomap
community.detection(network, algorithm = "infomap")
# Compute Label Propagation
community.detection(network, algorithm = "label_prop")
# Compute Leading Eigenvector
community.detection(network, algorithm = "leading_eigen")
# Compute Leiden (with modularity)
community.detection(
network, algorithm = "leiden",
objective_function = "modularity"
)
# Compute Leiden (with CPM)
community.detection(
network, algorithm = "leiden",
objective_function = "CPM",
resolution_parameter = 0.05 # "edge density"
)
# Compute Louvain
community.detection(network, algorithm = "louvain")
# Compute Optimal (identifies maximum modularity solution)
community.detection(network, algorithm = "optimal")
# Compute Spinglass
community.detection(network, algorithm = "spinglass")
# Compute Walktrap
community.detection(network, algorithm = "walktrap")
# Example with {igraph} network
community.detection(
convert2igraph(network), algorithm = "walktrap"
)
Run the code above in your browser using DataLab