View source: R/svdcentrality.R
calc_centrality | R Documentation |
This function calculates the centrality of species in a network based on an adjacency matrix or igraph object using a specified centrality measure.
calc_centrality(A, centrality_func = eigen_centrality)
A |
An igraph object or an adjacency matrix. The values represent interaction strengths. |
centrality_func |
A function to compute centrality. Default is |
A list containing:
CentralityScores |
A data frame with species names and their centrality scores. |
Plot_Centrality |
A ggplot object showing the top 10 species by centrality. |
# Example usage with an adjacency matrix A
results <- calc_centrality(A, centrality_func = page_rank)
print(results$CentralityScores)
print(results$Plot_Centrality)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.