# Load data
wmt <- wmt2[,7:24]
# Estimate EGA
ega.wmt <- EGA(wmt, model = "glasso")
# Compute standard (absolute values) modularity
modularity(
network = ega.wmt$network,
memberships = ega.wmt$wc,
signed = FALSE
)
# 0.1697952
# Compute signed modularity
modularity(
network = ega.wmt$network,
memberships = ega.wmt$wc,
signed = TRUE
)
# 0.1701946
Run the code above in your browser using DataLab