Package 'MultiTraits'

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.1.0
Built: 2024-11-26 15:49:29 UTC
Source: CRAN

Help Index


Calculate CSR strategy for multiple plant species

Description

This function processes a dataframe containing leaf traits (LA, LDMC, SLA) and applies the Strate_CSR function to each row.

Usage

CSR(data)

Arguments

data

A dataframe containing columns for LA (Leaf Area), LDMC (Leaf Dry Matter Content), and SLA (Specific Leaf Area).

Value

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

References

  1. Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.

  2. 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.

Examples

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)

Create a ternary plot of CSR strategies

Description

This function creates a ternary plot of Competition-Stress-Ruderal (CSR) strategies using the ggtern package.

Usage

CSR_plot(data)

Arguments

data

A dataframe containing columns C, S, R, and type for CSR strategy values and plant types.

Details

The function uses ggtern to create a ternary plot with the following features:

  • Points colored and filled by plant type

  • Axis labels for C, S, and R percentages

  • A white background with RGB colored axes

  • Legend positioned at the bottom

Value

A ggplot object representing the ternary plot of CSR strategies.

References

  1. Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.

  2. 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.

Examples

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)
result <- CSR(data = traits)
CSR_plot(data=result)

Calculate LHS (Leaf-Height-Seed) Strategy

Description

This function calculates the LHS strategy for plant species based on their SLA (Specific Leaf Area), Height, and Seed Mass values.

Usage

LHS(data)

Arguments

data

A data frame containing columns for SLA, Height, and SeedMass.

Details

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.

Value

A data frame with an additional column 'LHS_strategy' containing the calculated LHS strategy.

References

  1. 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

  2. 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

Examples

data(PFF)
pff <- PFF[, c("SLA", "Height", "SeedMass")]
result <- LHS(pff)
head(result)

Generate a 3D scatterplot of plant traits

Description

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.

Usage

LHS_plot(
  data,
  colors = c("#30123BFF", "#4777EFFF", "#1BD0D5FF", "#62FC6BFF", "#D2E935FF",
    "#FE9B2DFF", "#DB3A07FF", "#7A0403FF"),
  log_transform = TRUE
)

Arguments

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.

Details

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.

Value

A 3D scatterplot of SLA, Height, and Seed Mass (optionally log-transformed), with points colored by LHS strategy.

References

  1. 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

  2. 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

Examples

data(PFF)
pff <- PFF[, c("SLA", "Height", "SeedMass")]
result <- LHS(pff)
LHS_plot(result)
LHS_plot(result, log_transform = FALSE)

Create a table of Leaf-Height-Seed (LHS) strategy types

Description

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.

Usage

LHS_strategy_scheme()

Value

A data frame with two columns:

type

Character vector of LHS strategy combinations (e.g., "L-L-L", "L-L-S", etc.)

strategy

Character vector describing the ecological strategy for each type

References

  1. 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

  2. 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

Examples

LHS_strategy_scheme()

Perform nested principal component analysis (PCA of PCAs) for ecological niche periodicity

Description

This function conducts a ‘PCA of PCAs’ to analyze ecological niche periodicity based on multiple trait dimensions.

Usage

NPT(data, dimension)

Arguments

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.

Details

The function performs the following steps:

  1. Checks and cleans input data, removing rows with NA values

  2. Conducts first-level PCA for each trait dimension

  3. Extracts PC1 and PC2 scores from each first-level PCA

  4. Combines all PC scores and performs a second-level PCA

  5. Returns summary statistics and results from both levels of analysis

Value

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

References

  1. 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

  2. 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

Examples

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

Plot results from nested principal component analysis

Description

This function creates a visualization of the results from the nested principal component analysis (NPT function) for ecological niche periodicity.

Usage

NPT_plot(pca_obj, group = NULL)

Arguments

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.

Details

The function creates a biplot that includes:

  1. Sample points colored by group

  2. Species scores represented as arrows

  3. 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.

Value

A ggplot object representing a biplot of species scores and sample points.

References

  1. 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

  2. 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

Examples

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)

Plant Functional Traits Dataset from Ponderosa Pine Forests Flora (PFF)

Description

A dataset containing functional traits for 133 plant species commonly found in southwestern USA Pinus ponderosa var. scopulorum P. & C. Lawson (ponderosa pine) forests.

Usage

PFF

Format

A data frame with 137 rows and 20 variables:

family

Plant family

species

Plant species

Height

Plant height (cm)

Leaf_area

Leaf area (mm^2)

LDMC

Leaf dry matter content (%)

SLA

Specific leaf area (mm^2/mg)

SRL

Specific root length (m/g)

SeedMass

Seed mass (mg)

FltDate

Flowering date (Julian day)

FltDur

Flowering duration (days)

k_value

k-value (not specified)

Leaf_Cmass

Leaf carbon content (% dry mass)

Leaf_Nmass

Leaf nitrogen content (% dry mass)

Leaf_CN

Leaf carbon to nitrogen ratio

Leaf_Pmass

Leaf phosphorus content (% dry mass)

Leaf_NP

Leaf nitrogen to phosphorus ratio

Leaf_CP

Leaf carbon to phosphorus ratio

Root_Cmass

Root carbon content (% dry mass)

Root_Nmass

Root nitrogen content (% dry mass)

Root_CN

Root carbon to nitrogen ratio

Details

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.

Source

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.

Examples

data(PFF)
head(PFF)

Calculate CSR (Competition-Stress-Ruderal) Strategy

Description

This function calculates the CSR strategy based on leaf traits.

Usage

Strate_CSR(LA, LDMC, SLA)

Arguments

LA

Leaf area in mm^2

LDMC

Leaf dry matter content in %

SLA

Specific leaf area in mm^2/mg

Value

A list containing:

  • C: Proportion of competition strategy

  • S: Proportion of stress-tolerance strategy

  • R: Proportion of ruderal strategy

  • type: Type of CSR strategy

References

  1. Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.

  2. 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.

Examples

Strate_CSR(LA = 369615.7, LDMC = 25.2, SLA = 17.4)

Generate Plant Trait Network

Description

This function creates a network graph from a plant trait correlation matrix, applying thresholds for correlation strength and significance.

Usage

TN(traits_matrix, rThres = 0.2, pThres = 0.05)

Arguments

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.

Details

The function performs the following steps:

  1. Calculates Pearson correlation coefficients and p-values for the trait matrix.

  2. Applies correlation coefficient and p-value thresholds to filter relationships.

  3. Constructs a weighted undirected graph from the filtered correlation matrix.

  4. Removes self-loops and isolated nodes from the graph.

  5. Adds correlation coefficients as edge attributes.

Value

Returns an igraph object representing the trait network.

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

data(WH)
WH <- WH[,4:23]
head(WH)
Tn_result <- TN(traits_matrix = WH, rThres = 0.2, pThres = 0.05)
Tn_result

Calculate and Visualize Plant Trait Correlation Network

Description

This function calculates correlation coefficients for given plant traits and generates a correlation network plot.

Usage

TN_corr(traits_matrix, rThres = 0.2, pThres = 0.05)

Arguments

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.

Details

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.

Value

Returns a correlation network plot object.

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

data(WH)
WH <- WH[,4:23]
head(WH)
TN_corr(traits_matrix = WH, rThres = 0.3, pThres = 0.01)

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)

Arguments

graph

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

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.

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

data(WH)
WH <- WH[,4:23]
Tn_result <- TN(traits_matrix = WH, rThres = 0.2, pThres = 0.05)
TN_metrics(Tn_result)

Plot Trait Network Graph

Description

This function visualizes the trait network graph generated by the TN function.

Usage

TN_plot(graph, style = 1)

Arguments

graph

An igraph object representing the trait network.

style

A numeric value that determines the plotting style (default is 1).

Details

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.

Value

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).

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

data(WH)
WH <- WH[,4:23]
Tn_result <- TN(traits_matrix = WH, rThres = 0.2, pThres = 0.05)
TN_plot(Tn_result, style = 1)
TN_plot(Tn_result, style = 2)

Wetland Herbaceous Plant Traits Dataset

Description

A dataset containing functional traits for 46 herbaceous wetland plant species grown in an experimental garden.

Usage

WH

Format

A data frame with 46 rows and 23 variables:

Species

Full scientific name of the species

species

Abbreviated species name

ROH

Root overwintering habits (P: Perennial, S: Autumn-senescing)

Height

Shoot height (cm)

ShDM

Shoot dry mass (g)

Depth

Rooting depth (cm)

RBD

Root branching density (no. cm^-1)

RBL

Root branching length (cm cm^-1)

RD_AR

Root diameter of axial roots (mm)

RD_LR

Root diameter of lateral roots (mm)

RDMC_AR

Root dry-matter content of axial roots (g g^-1)

RDMC_LR

Root dry-matter content of lateral roots (g g^-1)

SRL_AR

Specific root length of axial roots (m g^-1)

SRL_LR

Specific root length of lateral roots (m g^-1)

RP_AR

Root porosity of axial roots (mm^3 mm^-3)

RP_LR

Root porosity of lateral roots (mm^3 mm^-3)

LT

Leaf thickness (mm)

LDMC

Leaf dry-matter content (g g^-1)

SLA

Specific leaf area (m^2 kg^-1)

LP

Leaf porosity (mm^3 mm^-3)

RhDMC

Rhizome dry-matter content (g g^-1)

RhP

Rhizome porosity (mm^3 mm^-3)

LSI

Leaf senescence index (% senescence)

Details

This dataset contains measurements of 21 below- and aboveground traits for 46 herbaceous wetland species grown in a common garden setting. The study employs a detailed approach to trait measurement on roots, leaves, shoots, and selectively on rhizomes. Root traits are classified into functional entities – axial roots, lateral roots, and the entire root system – to capture the functional variation in root branching structures. Measurements include leaf morphology, porosity, and phenology, as well as characterization of fibrous root systems by their phenology, branching architecture, morphology, and tissue porosity.

Source

Ye, Z., Mu, Y., Van Duzen, S. and Ryser, P. (2024). Root and shoot phenology, architecture, and organ properties: an integrated trait network among 44 herbaceous wetland species. New Phytol. https://doi.org/10.1111/nph.19747

Examples

data(WH)
head(WH)