calculate_metrics: calculate_metrics

View source: R/calculate_metrics.R

calculate_metricsR Documentation

calculate_metrics

Description

calculate_metrics calculates for each edgelist in a list of edgelists the following network-level metrics: number of nodes, leading eigenvector modularity, weighted distance, weighted diameter, generalized clustering coefficient, and eigenvector centralization.

Usage

calculate_metrics(emp_el)

Arguments

emp_el

a list of matrices generated by the function import_emp(), with each matrix representing an augmented edgelist where the first two columns indicate the sending and receiving node of a tie, respectively, the third column indicates the tie weight, the first element of the fourth column indicates the number of nodes in the network, and the first element of the fifth column indicates the number of ties in the network.

Value

a dataframe of network metrics, where each row represents an edgelist fed into the function, and the first column represents the index of those edgelists. Columns 2-7 represent (in this order): number of nodes, leading eigenvector modularity, weighted distance, weighted diameter, generalized clustering coefficient, and eigenvector centralization of each network.

Examples

emp_el_w <- readRDS("./data/Effective_el_emp_w")
weighted_metrics <- calculate_metrics(emp_el_w)

collinmmccabe/enss documentation built on May 5, 2024, 6:23 a.m.