View source: R/compute_edge_frequencies.R
| compute_edge_frequencies | R Documentation |
This function computes the frequency of each edge (connection between nodes) across all graphs within each population.
compute_edge_frequencies(populations)
populations |
A list where each element is a population containing a list of graphs (adjacency matrices). |
A list containing edge counts and edge proportions for each population.
# Generate synthetic populations
control_graphs <- generate_category_graphs(
n_graphs = 5,
n_nodes = 10,
n_communities = 2,
base_intra_prob = 0.8,
base_inter_prob = 0.2,
seed = 1
)
patient_graphs <- generate_category_graphs(
n_graphs = 5,
n_nodes = 10,
n_communities = 2,
base_intra_prob = 0.6,
base_inter_prob = 0.4,
seed = 2
)
populations <- list(Control = control_graphs, Patient = patient_graphs)
# Compute edge frequencies
frequencies <- compute_edge_frequencies(populations)
# View edge counts for the first population
edge_counts_control <- frequencies$edge_counts[,,1]
print(edge_counts_control)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.