# Load data
wmt <- wmt2[,7:24]
# Estimate optimal EGA with Walktrap
fit.walktrap <- EGA.fit(
data = wmt, algorithm = "walktrap",
steps = 3:8, # default
plot.EGA = FALSE # no plot for CRAN checks
)
# Estimate optimal EGA with Leiden and CPM
fit.leiden <- EGA.fit(
data = wmt, algorithm = "leiden",
objective_function = "CPM", # default
# resolution_parameter = seq.int(0, max(abs(network)), 0.01),
# For CPM, the default max resolution parameter
# is set to the largest absolute edge in the network
plot.EGA = FALSE # no plot for CRAN checks
)
# Estimate optimal EGA with Leiden and modularity
fit.leiden <- EGA.fit(
data = wmt, algorithm = "leiden",
objective_function = "modularity",
resolution_parameter = seq.int(0, 2, 0.05),
# default for modularity
plot.EGA = FALSE # no plot for CRAN checks
)
if (FALSE) {
# Estimate optimal EGA with Louvain
fit.louvain <- EGA.fit(
data = wmt, algorithm = "louvain",
resolution_parameter = seq.int(0, 2, 0.05), # default
plot.EGA = FALSE # no plot for CRAN checks
)}
Run the code above in your browser using DataLab