Learn R Programming

MultiTraits (version 0.5.0)

TN_metrics: Calculate Node and Global Metrics for Trait Networks

Description

This function computes various node and global metrics for a trait network graph.

Usage

TN_metrics(graph)

Value

A list containing two data frames:

node

A data frame with node-level metrics including degree, closeness, betweenness, and local clustering coefficient.

global

A data frame with global metrics including edge density, diameter, average path length, average clustering coefficient, and modularity.

Arguments

graph

An igraph object representing the trait network, typically generated by the TN function.

References

  1. He, N., Li, Y., Liu, C., et al. (2020). Plant trait networks: improved resolution of the dimensionality of adaptation. Trends in Ecology & Evolution, 35(10), 908-918. https://doi.org/10.1016/j.tree.2020.06.003

  2. Li, Y., Liu, C., Sack, L., Xu, L., Li, M., Zhang, J., & He, N. (2022). Leaf trait network architecture shifts with species‐richness and climate across forests at continental scale. Ecology Letters, 25(6), 1442-1457. https://doi.org/10.1111/ele.14009

Examples

Run this code
data(PFF)
PFF_traits <- PFF[, c("Height", "Leaf_area","LDMC","SLA","SRL","SeedMass","FltDate",
                      "FltDur","Leaf_Cmass","Leaf_Nmass","Leaf_CN","Leaf_Pmass",
                      "Leaf_NP","Leaf_CP","Root_Cmass","Root_Nmass","Root_CN")]
PFF_traits <- na.omit(PFF_traits)
head(PFF_traits)
Tn_result <- TN(traits_matrix = PFF_traits, rThres = 0.2, pThres = 0.05)
TN_metrics(Tn_result)

Run the code above in your browser using DataLab