# Load data
dep <- depression[,24:44]
# Estimate correlations
corr <- qgraph::cor_auto(dep)
# Estimate network
net <- EBICglasso.qgraph(corr, n = nrow(dep))
# Estimate communities using modularity
louvain(net, method = "modularity")
# Estimate communities using tefi
louvain(net, method = "tefi", corr = corr)
Run the code above in your browser using DataLab