convert_EGA_to_df: Convert EGA Result to Data Frame

View source: R/convert_EGA_to_df.R

convert_EGA_to_dfR Documentation

Convert EGA Result to Data Frame

Description

Extracts network metrics from a single EGA result object.

Usage

convert_EGA_to_df(ega_result)

Arguments

ega_result

A single EGA result object, as returned by EGAnet::EGA().

Value

A one-row data frame with the network model, correlation method, community detection algorithm, lambda, number of nodes and edges, density, descriptive statistics of the non-zero edge weights, number of communities and TEFI.

Examples

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))

ega <- EGAnet::EGA(items, plot.EGA = FALSE)
convert_EGA_to_df(ega)

InterconectaR documentation built on Oct. 16, 2026, 1:06 a.m.