# Load data
data <- sim.dynEGA
if (FALSE) {
# Run dynEGA with optimization
optimized_all <- dynEGA(
data = data, level = c("individual", "population"),
n.embed = 3:25, n.embed.optimize = TRUE
)
# Cluster individuals
clust <- infoCluster(dynEGA.object = optimized_all)
# Cluster-level population networks
plot_clusters(
dynEGA.object = optimized_all,
clustering = clust,
type = "population"
)
# Average networks per cluster
plot_clusters(
dynEGA.object = optimized_all,
clustering = clust,
type = "average"
)
# Cluster-level population networks, including only Cluster 2:
plot_clusters(
dynEGA.object = optimized_all,
clustering = clust, include = 2,
type = "population"
)
# Using alternative clusters
plot_clusters(
dynEGA.object = optimized_all,
clustering = rep(1:2, each = 50), # vector of memberships
type = "population"
)
# Run with non-optimized dynEGA
standard_all <- dynEGA(
data = data,
level = c("individual", "population")
)
# Obtain clusters
clust_standard <- infoCluster(dynEGA.object = standard_all)
# Plot clusters with population
plot_clusters(
dynEGA.object = standard_all,
clustering = clust_standard,
type = "population"
)}
Run the code above in your browser using DataLab