community.homogenize: Homogenize Community Memberships

View source: R/community.homogenize.R

community.homogenizeR Documentation

Homogenize Community Memberships

Description

Memberships from community detection algorithms do not always align numerically. This function seeks to homogenize community memberships between a target membership (the membership to homogenize toward) and one or more other memberships. This function is the core of the dimensionStability and itemStability functions

Usage

community.homogenize(target.membership, convert.membership)

Arguments

target.membership

Vector, matrix, or data frame. The target memberships that all other memberships input into convert.membership should be homogenize toward

convert.membership

Vector, matrix, or data frame. Either a vector of memberships the same length as target.membership or a matrix or data frame of many membership solutions with either across rows or down columns the same length as target.membership (this function will automatically determine this orientation for you with precedence given solutions across rows)

Value

Returns a vector or matrix the length or size of convert.membership with memberships homogenized toward target.membership

Author(s)

Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>

References

Original implementation of bootEGA
Christensen, A. P., & Golino, H. (2021). Estimating the stability of the number of factors via Bootstrap Exploratory Graph Analysis: A tutorial. Psych, 3(3), 479-500.

Examples

# Get network
network <- network.estimation(wmt2[,7:24])

# Apply Walktrap
network_walktrap <- community.detection(
  network, algorithm = "walktrap"
)

# Apply Louvain
network_louvain <- community.detection(
  network, algorithm = "louvain"
)

# Homogenize toward Walktrap
community.homogenize(network_walktrap, network_louvain)


hfgolino/EGA documentation built on Nov. 11, 2024, 9:28 p.m.