View source: R/run_EGA_combinations.R
| run_EGA_combinations | R Documentation |
Runs EGA with multiple combinations of correlation methods and algorithms.
run_EGA_combinations(
data,
corr = c("cor_auto", "pearson", "spearman"),
algorithm = c("leiden", "louvain", "walktrap"),
leiden_args = list(objective_function = "CPM", resolution_parameter = 1)
)
data |
Data frame with the data. |
corr |
Character vector of correlation methods. |
algorithm |
Character vector of community detection algorithms. |
leiden_args |
List of additional arguments for the Leiden algorithm. |
A list of EGA results with class "EGA_combinations".
set.seed(123)
n <- 300
f1 <- rnorm(n)
f2 <- 0.3 * f1 + rnorm(n)
items <- data.frame(
sapply(1:4, function(i) 0.7 * f1 + rnorm(n, 0, 0.7)),
sapply(1:4, function(i) 0.7 * f2 + rnorm(n, 0, 0.7))
)
names(items) <- c(paste0("A", 1:4), paste0("B", 1:4))
combos <- run_EGA_combinations(items, corr = c("pearson", "spearman"),
algorithm = c("louvain", "walktrap"))
names(combos)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.