Title: | Analyzing and Visualizing Multidimensional Plant Traits |
---|---|
Description: | Implements analytical methods for multidimensional plant traits, including Competitors-Stress tolerators-Ruderals strategy analysis using leaf traits, Leaf-Height-Seed strategy analysis, Niche Periodicity Table analysis, and Trait Network analysis. Provides functions for data analysis, visualization, and network metrics calculation. Methods are based on Grime (1974) <doi:10.1038/250026a0>, Pierce et al. (2017) <doi:10.1111/1365-2435.12882>, Westoby (1998) <doi:10.1023/A:1004327224729>, Yang et al. (2022) <doi:10.1016/j.foreco.2022.120540>, Winemiller et al. (2015) <doi:10.1111/ele.12462>, He et al. (2020) <doi:10.1016/j.tree.2020.06.003>. |
Authors: | Yan He [aut, cre] |
Maintainer: | Yan He <[email protected]> |
License: | GPL-3 |
Version: | 0.2.0 |
Built: | 2024-12-21 17:09:46 UTC |
Source: | CRAN |
This function processes a dataframe containing leaf traits (LA, LDMC, SLA) and applies the Strate_CSR function to each row.
CSR(data)
CSR(data)
data |
A dataframe containing columns for LA (Leaf Area), LDMC (Leaf Dry Matter Content), and SLA (Specific Leaf Area). |
A dataframe with the original input data and additional columns:
C: Competitive strategy score
S: Stress-tolerant strategy score
R: Ruderal strategy score
type: The dominant CSR strategy type
Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.
Pierce, S., Negreiros, D., Cerabolini, B.E.L., Kattge, J., Díaz, S., et al. (2017). A global method for calculating plant CSR ecological strategies applied across biomes world-wide. Funct Ecol, 31: 444-457.
LA <- c(369615.7, 11.8, 55.7, 36061.2, 22391.8, 30068.1, 31059.5, 29895.1) LDMC <- c(25.2, 39.7, 13.3, 35.5, 33.2, 36.1, 35.2, 34.9) SLA <- c(17.4, 6.6, 34.1, 14.5, 8.1, 12.1, 9.4, 10.9) traits <- data.frame(LA, LDMC, SLA) CSR(data = traits)
LA <- c(369615.7, 11.8, 55.7, 36061.2, 22391.8, 30068.1, 31059.5, 29895.1) LDMC <- c(25.2, 39.7, 13.3, 35.5, 33.2, 36.1, 35.2, 34.9) SLA <- c(17.4, 6.6, 34.1, 14.5, 8.1, 12.1, 9.4, 10.9) traits <- data.frame(LA, LDMC, SLA) CSR(data = traits)
This function creates a ternary plot of Competition-Stress-Ruderal (CSR) strategies using the ggtern package.
CSR_plot( data, point_size = 3, point_shape = 21, expand_margin = 1, custom_colors = c("#57C4AD", "#E6E1BC", "#EDA348", "#006165", "#F8E3EF", "#FFFF99", "#376CB1", "#B2589B", "#DC4325", "#F16C4E", "#85B97B", "#FCEB2D", "#04A89E", "#F49320", "#8F88C1", "#33B5D9", "#440153", "#B29BBD", "#28C865") )
CSR_plot( data, point_size = 3, point_shape = 21, expand_margin = 1, custom_colors = c("#57C4AD", "#E6E1BC", "#EDA348", "#006165", "#F8E3EF", "#FFFF99", "#376CB1", "#B2589B", "#DC4325", "#F16C4E", "#85B97B", "#FCEB2D", "#04A89E", "#F49320", "#8F88C1", "#33B5D9", "#440153", "#B29BBD", "#28C865") )
data |
A dataframe containing required columns: C, S, R (numeric values between 0-1) and type (categorical classification) |
point_size |
Numeric, diameter of plot points (default = 3) |
point_shape |
Numeric, symbol code for data points (default = 21, circle with border) |
expand_margin |
Numeric, coefficient for plot margin expansion (default = 1) |
custom_colors |
Character vector specifying hex color codes for categorical types |
This function implements:
Configurable point attributes (size, shape)
Adjustable plot boundaries
User-defined color schemes for categories
Automated legend column optimization
Standardized legend positioning
Reference grid and directional indicators
A ggplot object representing the ternary plot of CSR strategies.
Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.
Pierce, S., Negreiros, D., Cerabolini, B.E.L., Kattge, J., Díaz, S., et al. (2017). A global method for calculating plant CSR ecological strategies applied across biomes world-wide. Funct Ecol, 31: 444-457.
data(PFF) head(PFF) traits <- data.frame(LA=PFF$Leaf_area, LDMC=PFF$LDMC, SLA=PFF$SLA) head(traits) result <- CSR(data = traits) head(result) CSR_plot(data=result)
data(PFF) head(PFF) traits <- data.frame(LA=PFF$Leaf_area, LDMC=PFF$LDMC, SLA=PFF$SLA) head(traits) result <- CSR(data = traits) head(result) CSR_plot(data=result)
This function calculates the LHS strategy for plant species based on their SLA (Specific Leaf Area), Height, and Seed Mass values.
LHS(data)
LHS(data)
data |
A data frame containing columns for SLA, Height, and SeedMass. |
The function calculates median values for SLA, Height, and SeedMass from the input data. It then determines the LHS strategy for each species based on whether its trait values are less than or equal to (S) or greater than (L) the median values.
The resulting strategy is a combination of three letters (S or L) representing Leaf (SLA), Height, and Seed (SeedMass) respectively, separated by hyphens.
A data frame with an additional column 'LHS_strategy' containing the calculated LHS strategy.
Westoby, M. (1998). A leaf-height-seed (LHS) plant ecology strategy scheme. Plant and Soil, 199, 213–227. https://doi.org/10.1023/A:1004327224729
Yang, J., Wang, Z., Zheng, Y., & Pan, Y. (2022). Shifts in plant ecological strategies in remnant forest patches along urbanization gradients. Forest Ecology and Management, 524, 120540. https://doi.org/10.1016/j.foreco.2022.120540
data(PFF) pff <- PFF[, c("SLA", "Height", "SeedMass")] result <- LHS(pff) head(result)
data(PFF) pff <- PFF[, c("SLA", "Height", "SeedMass")] result <- LHS(pff) head(result)
This function creates a three-dimensional scatterplot of plant traits (Specific Leaf Area, Height, and Seed Mass) based on the Leaf-Height-Seed (LHS) plant ecology strategy scheme.
LHS_plot( data, colors = c("#30123BFF", "#4777EFFF", "#1BD0D5FF", "#62FC6BFF", "#D2E935FF", "#FE9B2DFF", "#DB3A07FF", "#7A0403FF"), log_transform = TRUE )
LHS_plot( data, colors = c("#30123BFF", "#4777EFFF", "#1BD0D5FF", "#62FC6BFF", "#D2E935FF", "#FE9B2DFF", "#DB3A07FF", "#7A0403FF"), log_transform = TRUE )
data |
A data frame containing columns: SLA, Height, SeedMass, and LHS_strategy. |
colors |
A vector of colors for different LHS strategies. Default is a predefined color palette. |
log_transform |
Logical, indicating whether to log-transform the data. Default is TRUE. |
The function performs the following steps: Checks if the input data contains the required columns. Converts LHS_strategy to a factor. Optionally log-transforms the data based on the log_transform parameter. Creates a 3D scatterplot using (potentially log-transformed) values of SLA, Height, and Seed Mass. Colors points based on LHS strategy. Adds a legend to identify different LHS strategies.
A 3D scatterplot of SLA, Height, and Seed Mass (optionally log-transformed), with points colored by LHS strategy.
Westoby, M. (1998). A leaf-height-seed (LHS) plant ecology strategy scheme. Plant and Soil, 199, 213–227. https://doi.org/10.1023/A:1004327224729
Yang, J., Wang, Z., Zheng, Y., & Pan, Y. (2022). Shifts in plant ecological strategies in remnant forest patches along urbanization gradients. Forest Ecology and Management, 524, 120540. https://doi.org/10.1016/j.foreco.2022.120540
data(PFF) pff <- PFF[, c("SLA", "Height", "SeedMass")] result <- LHS(pff) LHS_plot(result) LHS_plot(result, log_transform = FALSE)
data(PFF) pff <- PFF[, c("SLA", "Height", "SeedMass")] result <- LHS(pff) LHS_plot(result) LHS_plot(result, log_transform = FALSE)
This function generates a data frame containing different plant growth strategies based on the Leaf-Height-Seed (LHS) scheme. Each strategy is described by a combination of traits and their corresponding ecological interpretation.
LHS_strategy_scheme()
LHS_strategy_scheme()
A data frame with two columns:
Character vector of LHS strategy combinations (e.g., "L-L-L", "L-L-S", etc.)
Character vector describing the ecological strategy for each type
Westoby, M. (1998). A leaf-height-seed (LHS) plant ecology strategy scheme. Plant and Soil, 199, 213–227. https://doi.org/10.1023/A:1004327224729
Yang, J., Wang, Z., Zheng, Y., & Pan, Y. (2022). Shifts in plant ecological strategies in remnant forest patches along urbanization gradients. Forest Ecology and Management, 524, 120540. https://doi.org/10.1016/j.foreco.2022.120540
LHS_strategy_scheme()
LHS_strategy_scheme()
This function conducts a ‘PCA of PCAs’ to analyze ecological niche periodicity based on multiple trait dimensions.
NPT(data, dimension)
NPT(data, dimension)
data |
A data frame containing species trait data. |
dimension |
A list of character vectors, each representing a trait dimension with corresponding column names from the data. |
The function performs the following steps:
Checks and cleans input data, removing rows with NA values
Conducts first-level PCA for each trait dimension
Extracts PC1 and PC2 scores from each first-level PCA
Combines all PC scores and performs a second-level PCA
Returns summary statistics and results from both levels of analysis
A list containing three elements:
PCA_first |
A data frame summarizing the first-level PCA results for each dimension |
PCA_second |
A matrix of species scores from the second-level PCA |
result |
The complete rda object from the second-level PCA |
Winemiller, K. O., Fitzgerald, D. B., Bower, L. M., & Pianka, E. R. (2015). Functional traits, convergent evolution, and periodic tables of niches. Ecology letters, 18(8), 737-751. https://doi.org/10.1111/ele.12462
Yu, R., Huang, J., Xu, Y., Ding, Y., & Zang, R. (2020). Plant functional niches in forests across four climatic zones: Exploring the periodic table of niches based on plant functional traits. Frontiers in Plant Science, 11, 841. https://doi.org/10.3389/fpls.2020.00841
data(PFF) PFF[,3:20] <- log(PFF[,3:20]) traits_dimension <- list( grow = c("SLA","Leaf_area","LDMC","SRL","Leaf_Nmass","Leaf_Pmass","Root_Nmass"), survive = c("Height","Leaf_Cmass","Root_Cmass","Leaf_CN","Leaf_NP","Leaf_CP","Root_CN"), reproductive = c("SeedMass","FltDate","FltDur") ) result <- NPT(data = PFF, dimension = traits_dimension) result
data(PFF) PFF[,3:20] <- log(PFF[,3:20]) traits_dimension <- list( grow = c("SLA","Leaf_area","LDMC","SRL","Leaf_Nmass","Leaf_Pmass","Root_Nmass"), survive = c("Height","Leaf_Cmass","Root_Cmass","Leaf_CN","Leaf_NP","Leaf_CP","Root_CN"), reproductive = c("SeedMass","FltDate","FltDur") ) result <- NPT(data = PFF, dimension = traits_dimension) result
This function creates a visualization of the results from the nested principal component analysis (NPT function) for ecological niche periodicity.
NPT_plot(pca_obj, group = NULL)
NPT_plot(pca_obj, group = NULL)
pca_obj |
An rda object returned by the second-level PCA in the NPT function. |
group |
A vector or factor specifying the grouping of samples. |
The function creates a biplot that includes:
Sample points colored by group
Species scores represented as arrows
Species labels positioned using ggrepel to avoid overlapping
The plot also includes dashed lines at x=0 and y=0, and displays the percentage of variance explained by each principal component on the axes.
A ggplot object representing a biplot of species scores and sample points.
Winemiller, K. O., Fitzgerald, D. B., Bower, L. M., & Pianka, E. R. (2015). Functional traits, convergent evolution, and periodic tables of niches. Ecology letters, 18(8), 737-751. https://doi.org/10.1111/ele.12462
Yu, R., Huang, J., Xu, Y., Ding, Y., & Zang, R. (2020). Plant functional niches in forests across four climatic zones: Exploring the periodic table of niches based on plant functional traits. Frontiers in Plant Science, 11, 841. https://doi.org/10.3389/fpls.2020.00841
data(PFF) PFF[,3:20] <- log(PFF[,3:20]) PFF <- na.omit(PFF) traits_dimension <- list( grow = c("SLA","Leaf_area","LDMC","SRL","Leaf_Nmass","Leaf_Pmass","Root_Nmass"), survive = c("Height","Leaf_Cmass","Root_Cmass","Leaf_CN","Leaf_NP","Leaf_CP","Root_CN"), reproductive = c("SeedMass","FltDate","FltDur") ) npt_result <- NPT(data = PFF, dimension = traits_dimension) dev.new() # A window that is too small will interfere with the drawing. # Optionally, you can set the drawing window to pop up automatically. NPT_plot(npt_result$result) NPT_plot(npt_result$result, PFF$family)
data(PFF) PFF[,3:20] <- log(PFF[,3:20]) PFF <- na.omit(PFF) traits_dimension <- list( grow = c("SLA","Leaf_area","LDMC","SRL","Leaf_Nmass","Leaf_Pmass","Root_Nmass"), survive = c("Height","Leaf_Cmass","Root_Cmass","Leaf_CN","Leaf_NP","Leaf_CP","Root_CN"), reproductive = c("SeedMass","FltDate","FltDur") ) npt_result <- NPT(data = PFF, dimension = traits_dimension) dev.new() # A window that is too small will interfere with the drawing. # Optionally, you can set the drawing window to pop up automatically. NPT_plot(npt_result$result) NPT_plot(npt_result$result, PFF$family)
A dataset containing functional traits for 133 plant species commonly found in southwestern USA Pinus ponderosa var. scopulorum P. & C. Lawson (ponderosa pine) forests.
PFF
PFF
A data frame with 137 rows and 20 variables:
Plant family
Plant species
Canopy height (cm)
Leaf area (mm^2)
Leaf dry matter content (%)
Specific leaf area (mm^2/mg)
Specific root length (m/g)
Seed mass (mg)
mean Flowering date (Julian day)
mean Flowering duration (days)
decomposition decay constant, where proportion of original mass remaining = exp(- k-value*0.926)
Leaf carbon content (% dry mass)
Leaf nitrogen content (% dry mass)
Leaf carbon to nitrogen ratio
Leaf phosphorus content (% dry mass)
Leaf nitrogen to phosphorus ratio
Leaf carbon to phosphorus ratio
Root carbon content (% dry mass)
Root nitrogen content (% dry mass)
Root carbon to nitrogen ratio
This dataset contains measurements of a core set of functional traits that reflect aspects of each species' ability to disperse, establish, acquire water and nutrients, and photosynthesize. Traits include specific leaf area (SLA), height, seed mass, specific root length (SRL), leaf and fine root nitrogen concentration, leaf phosphorus concentration, and leaf dry matter content (LDMC). Julian flowering date and flowering duration were also obtained for each species. Leaf litter decomposition rates were measured on 103 species.
Laughlin, D. C., Leppert, J. J., Moore, M. M., & Sieg, C. H. (2010). A multi-trait test of the leaf-height-seed plant strategy scheme with 133 species from a pine forest flora. Functional Ecology, 24(3), 485-700.
data(PFF) head(PFF)
data(PFF) head(PFF)
This function calculates the CSR strategy based on leaf traits.
Strate_CSR(LA, LDMC, SLA)
Strate_CSR(LA, LDMC, SLA)
LA |
Leaf area in mm^2 |
LDMC |
Leaf dry matter content in % |
SLA |
Specific leaf area in mm^2/mg |
A list containing:
C
: Proportion of competition strategy
S
: Proportion of stress-tolerance strategy
R
: Proportion of ruderal strategy
type
: Type of CSR strategy
Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.
Pierce, S., Negreiros, D., Cerabolini, B.E.L., Kattge, J., Díaz, S., et al. (2017). A global method for calculating plant CSR ecological strategies applied across biomes world-wide. Funct Ecol, 31: 444-457.
Strate_CSR(LA = 369615.7, LDMC = 25.2, SLA = 17.4)
Strate_CSR(LA = 369615.7, LDMC = 25.2, SLA = 17.4)
This function creates a network graph from a plant trait correlation matrix, applying thresholds for correlation strength and significance.
TN(traits_matrix, rThres = 0.2, pThres = 0.05, method = "pearson")
TN(traits_matrix, rThres = 0.2, pThres = 0.05, method = "pearson")
traits_matrix |
A numeric matrix where each column represents a plant trait and each row represents a sample. |
rThres |
Numeric, threshold for correlation coefficient, default is 0.2. Correlations with absolute values below this threshold are set to zero. |
pThres |
Numeric, threshold for p-value, default is 0.05. Only correlations with p-values below this threshold are included in the network. |
method |
Character, specifies the correlation method to use: "pearson" (default) or "spearman". |
The function performs the following steps:
Calculates Pearson correlation coefficients and p-values for the trait matrix.
Applies correlation coefficient and p-value thresholds to filter relationships.
Constructs a weighted undirected graph from the filtered correlation matrix.
Removes self-loops and isolated nodes from the graph.
Adds correlation coefficients as edge attributes.
Returns an igraph object representing the trait network.
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
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
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, method = "pearson") Tn_result
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, method = "pearson") Tn_result
This function calculates correlation coefficients for given plant traits and generates a correlation network plot.
TN_corr(traits_matrix, rThres = 0.2, pThres = 0.05, method = "pearson")
TN_corr(traits_matrix, rThres = 0.2, pThres = 0.05, method = "pearson")
traits_matrix |
A numeric matrix where each column represents a plant trait and each row represents a sample. |
rThres |
Numeric, threshold for correlation coefficient, default is 0.2. Only correlations with absolute values above this threshold will be displayed in the plot. |
pThres |
Numeric, threshold for p-value, default is 0.05. Only correlations with p-values below this threshold will be displayed in the plot. |
method |
Character, specifies the correlation method to use: "pearson" (default) or "spearman". |
The function first calculates Pearson correlation coefficients between traits, then adjusts p-values using the FDR method. Finally, it plots the correlation network using the corrplot package. The plot displays only correlations that meet both the correlation coefficient and p-value thresholds.
Returns a correlation network plot object.
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
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
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_corr(traits_matrix = PFF_traits, rThres = 0.3, pThres = 0.01,method = "pearson")
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_corr(traits_matrix = PFF_traits, rThres = 0.3, pThres = 0.01,method = "pearson")
This function computes various node and global metrics for a trait network graph.
TN_metrics(graph)
TN_metrics(graph)
graph |
An igraph object representing the trait network, typically generated by the |
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. |
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
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
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)
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)
This function visualizes the trait network graph generated by the TN
function.
TN_plot(graph, style = 1, vertex.size = 20, vertex.label.cex = 0.6)
TN_plot(graph, style = 1, vertex.size = 20, vertex.label.cex = 0.6)
graph |
An igraph object representing the trait network. |
style |
A numeric value that determines the plotting style (default is 1). |
vertex.size |
Numeric value for the size of vertices in the plot (default is 20). |
vertex.label.cex |
Numeric value for the scaling factor of vertex labels (default is 0.6). |
The function uses the cluster_fast_greedy
algorithm to identify communities
in the graph and assigns community membership to vertices. It offers two
plotting styles:
Style 1: Plots the community structure.
Style 2: Plots the graph in a circular layout with vertex colors representing communities. The vertex size and label size can be customized using vertex.size and vertex.label.cex parameters respectively.
An object of class igraph
. This function generates a visualization of the trait network graph.
When style = 1, it displays a community structure plot.
When style = 2, it displays a circular layout plot where vertex colors represent community membership,
edge thickness represents correlation strength, and edge color represents the sign of the correlation (black for positive, red for negative).
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
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
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_plot(Tn_result, style = 1, vertex.size = 20, vertex.label.cex = 0.6) TN_plot(Tn_result, style = 2, vertex.size = 20, vertex.label.cex = 0.6)
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_plot(Tn_result, style = 1, vertex.size = 20, vertex.label.cex = 0.6) TN_plot(Tn_result, style = 2, vertex.size = 20, vertex.label.cex = 0.6)