MultiTraits_tutorial

He Yan

2024.12.21

Introduction

Plant functional traits and their multidimensional trade-offs represent fundamental aspects of plant ecological research. The MultiTraits R package integrates four complementary analytical modules: Competitor-Stress tolerator-Ruderal (CSR) strategy analysis, Leaf-Height-Seed (LHS) strategy analysis, Niche Periodicity Table (NPT) analysis, and Trait Network (TN) analysis, providing researchers with a comprehensive analytical platform. This tutorial aims to guide users through the core functionalities and practical applications of the MultiTraits package. Through practical demonstrations, we illustrate how these analytical modules can be utilized to explore multidimensional relationships among plant traits, including key steps in data preparation, analysis workflows, and result visualization.

Installation

From GitHub (development version)

# if (!requireNamespace("devtools", quietly = TRUE)) {install.packages("devtools")}
# devtools::install_github("biodiversity-monitoring/MultiTraits")

Main Functions

Module Function Description
CSR CSR_strategy() Computes C-S-R ecological strategy coordinates for individual plant species based on key functional traits
CSR() Performs batch calculation of C-S-R strategies across multiple plant species simultaneously
CSR_plot() Generates publication-quality ternary plots for visualizing C-S-R strategy distributions
LHS LHS() Analyzes and classifies plant species into ecological strategy types based on the Leaf-Height-Seed (LHS) trait spectrum
LHS_plot() Renders three-dimensional visualization of species distribution in LHS strategy space
LHS_strategy_scheme() Generates standardized classification scheme for LHS ecological strategies ^
NPT NPT() Implements hierarchical principal component analysis to identify ecological niche periodicity patterns
NPT_plot() Visualizes results of niche periodicity analysis through ordination plots
TN TN_corr() Analyzes and visualizes correlation structure within plant trait networks
TN() Constructs functional trait networks based on specified correlation thresholds
TN_metrics() Calculates network centrality metrics and topological properties
TN_plot() Renders customizable network graphs highlighting trait relationships

Example Datasets: PFF (Pine Forests Flora)

The package includes a built-in example dataset called PFF that can be loaded as follows:

library(MultiTraits)
## Loading required package: ggplot2
## Registered S3 methods overwritten by 'ggtern':
##   method           from   
##   grid.draw.ggplot ggplot2
##   plot.ggplot      ggplot2
##   print.ggplot     ggplot2
data(PFF)
# View the structure of the datasets
head(PFF)
##        family                   species Height Leaf_area LDMC SLA SRL SeedMass
## 1  Asteraceae      Achillea millefolium     14       240   27   8  35    0.140
## 2  Asteraceae           Agoseris glauca     12       520   17  20  56    2.530
## 3     Poaceae      Agropyron desertorum     26       290   42   9  99    0.388
## 4  Asteraceae     Ambrosia psilostachya     44       490   20  16  73    5.896
## 5 Primulaceae Androsace septentrionalis      1        51   14  31  80    0.128
## 6  Asteraceae     Antennaria parvifolia      2        66   27  13  27    0.061
##   FltDate FltDur k_value Leaf_Cmass Leaf_Nmass Leaf_CN Leaf_Pmass Leaf_NP
## 1     197    152    1.70      41.16       1.92      22       0.36       6
## 2     213    183    1.10      42.62       1.72      25       0.39       4
## 3     198     91      NA      41.48       2.32      18       0.06      52
## 4     243    122    2.23      38.42       2.32      17       0.25      14
## 5     182    182      NA      40.83       1.95      22       0.29       7
## 6     182    122    0.54      44.07       1.53      30       0.18       9
##   Leaf_CP Root_Cmass Root_Nmass Root_CN
## 1     114      40.96       0.48      85
## 2     109      45.86       0.89      52
## 3    1021      41.46       1.61      26
## 4     224      35.69       1.29      28
## 5     131      46.46       1.23      38
## 6     252      35.96       0.55      65

The PFF dataset contains trait measurements for plant species found in pine forests, with the following variables:

Height: Maximum plant height (cm)

Leaf_area: Leaf area (cm²)

LDMC: Leaf dry matter content (mg/g)

SLA: Specific leaf area (mm²/mg)

SRL: Specific root length

SeedMass: Seed mass

FltDate: Flowering date

FltDur: Flowering duration

k_value: Decomposition rate

Leaf_Cmass: Leaf carbon content

Leaf_Nmass: Leaf nitrogen content

Leaf_CN: Leaf carbon/nitrogen ratio

Leaf_Pmass: Leaf phosphorus content

Leaf_NP: Leaf nitrogen/phosphorus ratio

Leaf_CP: Leaf carbon/phosphorus ratio

Root_Cmass: Root carbon content

Root_Nmass: Root nitrogen content

Root_CN: Root carbon/nitrogen ratio

CSR Strategy

The CSR strategy analysis is based on Pierce et al.’s (2017) global CSR methodology, which uses three key leaf traits: Leaf Area (LA), Leaf Dry Matter Content (LDMC), and Specific Leaf Area (SLA). Using the MultiTraits package, we analyze these traits for 133 plant species from the PFF dataset. The CSR() function calculates the C, S, and R scores for each species, while CSR_plot() creates a ternary plot showing the distribution of species along the three strategy axes. This visualization helps identify whether species tend toward competitive (C), stress-tolerant (S), or ruderal (R) life strategies.

# Load the PFF dataset
data(PFF)
head(PFF)
##        family                   species Height Leaf_area LDMC SLA SRL SeedMass
## 1  Asteraceae      Achillea millefolium     14       240   27   8  35    0.140
## 2  Asteraceae           Agoseris glauca     12       520   17  20  56    2.530
## 3     Poaceae      Agropyron desertorum     26       290   42   9  99    0.388
## 4  Asteraceae     Ambrosia psilostachya     44       490   20  16  73    5.896
## 5 Primulaceae Androsace septentrionalis      1        51   14  31  80    0.128
## 6  Asteraceae     Antennaria parvifolia      2        66   27  13  27    0.061
##   FltDate FltDur k_value Leaf_Cmass Leaf_Nmass Leaf_CN Leaf_Pmass Leaf_NP
## 1     197    152    1.70      41.16       1.92      22       0.36       6
## 2     213    183    1.10      42.62       1.72      25       0.39       4
## 3     198     91      NA      41.48       2.32      18       0.06      52
## 4     243    122    2.23      38.42       2.32      17       0.25      14
## 5     182    182      NA      40.83       1.95      22       0.29       7
## 6     182    122    0.54      44.07       1.53      30       0.18       9
##   Leaf_CP Root_Cmass Root_Nmass Root_CN
## 1     114      40.96       0.48      85
## 2     109      45.86       0.89      52
## 3    1021      41.46       1.61      26
## 4     224      35.69       1.29      28
## 5     131      46.46       1.23      38
## 6     252      35.96       0.55      65
# Select required traits for CSR analysis
traits <- data.frame(LA=PFF$Leaf_area, LDMC=PFF$LDMC, SLA=PFF$SLA)
head(traits)
##    LA LDMC SLA
## 1 240   27   8
## 2 520   17  20
## 3 290   42   9
## 4 490   20  16
## 5  51   14  31
## 6  66   27  13
# Perform CSR analysis
result <- CSR(data = traits)
head(result)
##    LA LDMC SLA         C         S        R type
## 1 240   27   8 18.845244 81.154756  0.00000 S/CS
## 2 520   17  20 34.290705  4.542473 61.16682 R/CR
## 3 290   42   9 12.118306 87.881694  0.00000    S
## 4 490   20  16 30.293240 30.891427 38.81533  CSR
## 5  51   14  31  4.068212  0.000000 95.93179    R
## 6  66   27  13  5.131786 73.958953 20.90926 S/SR
# Visualize CSR strategy results
CSR_plot(data=result, expand_margin = 1)

LHS Strategy

The LHS (Leaf-Height-Seed) strategy analysis is based on three key plant functional traits: specific leaf area (SLA), plant height, and seed mass. The LHS() function in the MultiTraits package classifies plants into eight ecological strategy types, reflecting trade-offs in resource acquisition, competitive ability, and reproductive strategies. The analysis results can be visualized in three-dimensional space using the LHS_plot() function, while LHS_strategy_scheme() illustrates the ecological significance of the eight strategy types. This analytical approach helps understand how plants adapt to environments through different trait combinations.

# Load the PFF dataset
data(PFF)
# Select specific columns (SLA, Height, SeedMass) from the PFF dataset
pff <- PFF[, c("SLA", "Height", "SeedMass")]
head(pff)
##   SLA Height SeedMass
## 1   8     14    0.140
## 2  20     12    2.530
## 3   9     26    0.388
## 4  16     44    5.896
## 5  31      1    0.128
## 6  13      2    0.061
# Perform LHS (Leaf-Height-Seed) analysis on the selected data
result <- LHS(pff)
head(result)
##   SLA Height SeedMass LHS_strategy
## 1   8     14    0.140        S-S-S
## 2  20     12    2.530        L-S-L
## 3   9     26    0.388        S-L-S
## 4  16     44    5.896        L-L-L
## 5  31      1    0.128        L-S-S
## 6  13      2    0.061        S-S-S
table(result$LHS_strategy)
## 
## L-L-L L-L-S L-S-L L-S-S S-L-L S-L-S S-S-L S-S-S 
##    16    18    11    21    20     9    19    19
# Create a visualization plot of the LHS analysis results
LHS_plot(result)

# Display the LHS strategy scheme diagram
LHS_strategy_scheme()
##    type                                                         strategy
## 1 L-L-L           Rapid growth, strong survivability and competitiveness
## 2 L-L-S      Rapid growth, strong survivability and weak competitiveness
## 3 L-S-L Rapid growth, long-distance dispersal and strong competitiveness
## 4 L-S-S   Rapid growth, long-distance dispersal and weak competitiveness
## 5 S-L-L            Slow growth, strong survivability and competitiveness
## 6 S-L-S       Slow growth, strong survivability and weak competitiveness
## 7 S-S-L  Slow growth, long-distance dispersal and strong competitiveness
## 8 S-S-S    Slow growth, long-distance dispersal and weak competitiveness

Niche Periodicity Table

The Niche Periodicity Table (NPT) analysis employs a “PCA of PCAs” approach to explore how plant functional traits are distributed across environmental gradients. While traditionally organized into three fundamental dimensions - growth, survival, and reproduction - these dimensions are not fixed and can be customized according to specific research questions and hypotheses. The NPT function processes these trait dimensions (whether three or more) to create a comprehensive view of plant ecological strategies, while NPT_plot generates visualizations that can be enhanced by adding taxonomic information such as plant family classifications.

# Load the PFF dataset
data(PFF)
# Log-transform columns 3-20 of the dataset
PFF[,3:20] <- log(PFF[,3:20])
# Remove rows with missing values (NA)
PFF <- na.omit(PFF)
head(PFF)
##            family               species    Height Leaf_area     LDMC      SLA
## 1      Asteraceae  Achillea millefolium 2.6390573  5.480639 3.295837 2.079442
## 2      Asteraceae       Agoseris glauca 2.4849066  6.253829 2.833213 2.995732
## 4      Asteraceae Ambrosia psilostachya 3.7841896  6.194405 2.995732 2.772589
## 6      Asteraceae Antennaria parvifolia 0.6931472  4.189655 3.295837 2.564949
## 7      Asteraceae   Antennaria rosulata 0.0000000  3.401197 3.367296 2.944439
## 8 Caryophyllaceae     Arenaria fendleri 2.0794415  3.465736 3.295837 2.564949
##        SRL   SeedMass  FltDate   FltDur     k_value Leaf_Cmass Leaf_Nmass
## 1 3.555348 -1.9661129 5.283204 5.023881  0.53062825   3.717467  0.6523252
## 2 4.025352  0.9282193 5.361292 5.209486  0.09531018   3.752324  0.5423243
## 4 4.290459  1.7742742 5.493061 4.804021  0.80200159   3.648578  0.8415672
## 6 3.295837 -2.7968814 5.204007 4.804021 -0.61618614   3.785779  0.4252677
## 7 3.401197 -2.6172958 5.204007 4.804021 -0.43078292   3.731939  0.4637340
## 8 3.912023 -1.6928195 5.204007 5.204007  0.03922071   3.768845  0.5538851
##    Leaf_CN Leaf_Pmass  Leaf_NP  Leaf_CP Root_Cmass  Root_Nmass  Root_CN
## 1 3.091042 -1.0216512 1.791759 4.736198   3.712596 -0.73396918 4.442651
## 2 3.218876 -0.9416085 1.386294 4.691348   3.825593 -0.11653382 3.951244
## 4 2.833213 -1.3862944 2.639057 5.411646   3.574871  0.25464222 3.332205
## 6 3.401197 -1.7147984 2.197225 5.529429   3.582407 -0.59783700 4.174387
## 7 3.258097 -1.7719568 2.302585 5.583496   3.723522 -0.89159812 4.615121
## 8 3.218876 -2.0402208 2.639057 5.831882   3.795714 -0.04082199 3.850148
# Define trait dimensions for NPT analysis
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"))
# Perform NPT analysis using the defined dimensions
npt_result <- NPT(data = PFF, dimension = traits_dimension)
npt_result
## $PCA_first
##              pc1_percent pc1_major_eigenvector pc2_percent
## grow            61.05240             Leaf_area   15.460864
## survive         48.69647                Height   35.885156
## reproductive    95.17637              SeedMass    4.170238
##              pc2_major_eigenvector
## grow                    Leaf_Pmass
## survive                    Leaf_CP
## reproductive                FltDur
## 
## $PCA_second
##                         PC1         PC2
## pc1.grow         -0.4421504  0.29926226
## pc2.grow         -0.2646905 -0.47439875
## pc1.survive      -0.4575448  0.19461245
## pc2.survive       0.1929222  0.51719484
## pc1.reproductive -0.5001406  0.02455148
## pc2.reproductive  0.1055980  0.07855093
## 
## $result
## Call: rda(X = P)
## 
##               Inertia Rank
## Total         0.05941     
## Unconstrained 0.05941    6
## Inertia is variance 
## 
## Eigenvalues for unconstrained axes:
##      PC1      PC2      PC3      PC4      PC5      PC6 
## 0.018757 0.015200 0.011163 0.005438 0.004725 0.004123
# Create a basic visualization of NPT results
NPT_plot(npt_result$result)

# Create a visualization of NPT results colored by plant family
NPT_plot(npt_result$result, PFF$family)

Trait Network

The Trait Network (TN) analysis module enables exploration of complex relationships between multiple plant traits. Using correlation analysis (Pearson or Spearman), it creates a network where traits are nodes and significant correlations form edges. The TN() function analyzes relationships, TN_corr() visualizes correlations, TN_metrics() calculates network properties, and TN_plot() offers two visualization styles. In the example, 17 key plant traits from the PFF dataset are analyzed, with correlations filtered by significance thresholds (rThres=0.2, pThres=0.05) after log transformation and NA removal.

# Load the PFF dataset
data(PFF)

# Select specific trait columns for analysis
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") ]
# Perform log transformation of data and remove missing values
PFF_traits <- log(na.omit(PFF_traits))
head(PFF_traits)
##      Height Leaf_area     LDMC      SLA      SRL   SeedMass  FltDate   FltDur
## 1 2.6390573  5.480639 3.295837 2.079442 3.555348 -1.9661129 5.283204 5.023881
## 2 2.4849066  6.253829 2.833213 2.995732 4.025352  0.9282193 5.361292 5.209486
## 3 3.2580965  5.669881 3.737670 2.197225 4.595120 -0.9467499 5.288267 4.510860
## 4 3.7841896  6.194405 2.995732 2.772589 4.290459  1.7742742 5.493061 4.804021
## 5 0.0000000  3.931826 2.639057 3.433987 4.382027 -2.0557250 5.204007 5.204007
## 6 0.6931472  4.189655 3.295837 2.564949 3.295837 -2.7968814 5.204007 4.804021
##   Leaf_Cmass Leaf_Nmass  Leaf_CN Leaf_Pmass  Leaf_NP  Leaf_CP Root_Cmass
## 1   3.717467  0.6523252 3.091042 -1.0216512 1.791759 4.736198   3.712596
## 2   3.752324  0.5423243 3.218876 -0.9416085 1.386294 4.691348   3.825593
## 3   3.725211  0.8415672 2.890372 -2.8134107 3.951244 6.928538   3.724729
## 4   3.648578  0.8415672 2.833213 -1.3862944 2.639057 5.411646   3.574871
## 5   3.709417  0.6678294 3.091042 -1.2378744 1.945910 4.875197   3.838592
## 6   3.785779  0.4252677 3.401197 -1.7147984 2.197225 5.529429   3.582407
##   Root_Nmass  Root_CN
## 1 -0.7339692 4.442651
## 2 -0.1165338 3.951244
## 3  0.4762342 3.258097
## 4  0.2546422 3.332205
## 5  0.2070142 3.637586
## 6 -0.5978370 4.174387
# Calculate trait correlations using specified thresholds
TN_corr(traits_matrix=PFF_traits, rThres = 0.2, pThres = 0.05,method = "pearson")

## $corr
##             Leaf_Cmass    SeedMass       Height    Leaf_area         SLA
## Leaf_Cmass  1.00000000  0.22978000  0.384636473  0.206554780 -0.18998237
## SeedMass    0.22978000  1.00000000  0.361121985  0.416619763 -0.15940285
## Height      0.38463647  0.36112198  1.000000000  0.452299592 -0.16412921
## Leaf_area   0.20655478  0.41661976  0.452299592  1.000000000  0.13682566
## SLA        -0.18998237 -0.15940285 -0.164129207  0.136825665  1.00000000
## Leaf_Pmass -0.05970399 -0.02079289  0.075885741  0.203112601  0.30203299
## FltDur     -0.04153009 -0.02443231 -0.211012698  0.108552587  0.13033932
## Leaf_Nmass  0.08286743  0.22882492  0.067455833  0.269333000  0.51747515
## Root_Nmass -0.14998887  0.09101701 -0.016426940  0.050510285  0.29408580
## Root_Cmass  0.04530142 -0.04710585  0.034900117  0.039292500 -0.07639932
## LDMC        0.30307272  0.10964199  0.301659012 -0.003080587 -0.47896555
## Leaf_CN     0.13416706 -0.20052995  0.009434968 -0.223032542 -0.53766219
## Root_CN     0.14757958 -0.10071061  0.030360449 -0.040347331 -0.29119563
## Leaf_NP     0.12258834  0.14314473 -0.011682975 -0.011125417  0.04562234
## Leaf_CP     0.19999186  0.03455441 -0.006257259 -0.143819859 -0.27574480
## SRL        -0.26965166 -0.42937100 -0.226394473 -0.390629158  0.26116253
## FltDate     0.03411447 -0.29470135  0.176465902 -0.030128255  0.12864332
##             Leaf_Pmass      FltDur  Leaf_Nmass  Root_Nmass  Root_Cmass
## Leaf_Cmass -0.05970399 -0.04153009  0.08286743 -0.14998887  0.04530142
## SeedMass   -0.02079289 -0.02443231  0.22882492  0.09101701 -0.04710585
## Height      0.07588574 -0.21101270  0.06745583 -0.01642694  0.03490012
## Leaf_area   0.20311260  0.10855259  0.26933300  0.05051028  0.03929250
## SLA         0.30203299  0.13033932  0.51747515  0.29408580 -0.07639932
## Leaf_Pmass  1.00000000  0.11851692  0.26074898  0.04890303 -0.04630048
## FltDur      0.11851692  1.00000000  0.13238657  0.13890508 -0.01082022
## Leaf_Nmass  0.26074898  0.13238657  1.00000000  0.52876638 -0.15697014
## Root_Nmass  0.04890303  0.13890508  0.52876638  1.00000000 -0.08359383
## Root_Cmass -0.04630048 -0.01082022 -0.15697014 -0.08359383  1.00000000
## LDMC       -0.21754303  0.04461883 -0.43485621 -0.32745254  0.09934752
## Leaf_CN    -0.25465544 -0.13259233 -0.97164631 -0.55088650  0.16825407
## Root_CN    -0.06412254 -0.13357624 -0.52910745 -0.96572894  0.33066731
## Leaf_NP    -0.70514044 -0.05874797  0.35059829  0.22562513  0.02677610
## Leaf_CP    -0.88553166 -0.14723135 -0.20526729 -0.07985607  0.10018531
## SRL        -0.03387244 -0.14561437 -0.04037146  0.06146170 -0.08854235
## FltDate    -0.01149970 -0.03573571  0.04398669  0.12121725 -0.02448182
##                    LDMC      Leaf_CN     Root_CN     Leaf_NP      Leaf_CP
## Leaf_Cmass  0.303072716  0.134167058  0.14757958  0.12258834  0.199991857
## SeedMass    0.109641991 -0.200529948 -0.10071061  0.14314473  0.034554412
## Height      0.301659012  0.009434968  0.03036045 -0.01168298 -0.006257259
## Leaf_area  -0.003080587 -0.223032542 -0.04034733 -0.01112542 -0.143819859
## SLA        -0.478965555 -0.537662192 -0.29119563  0.04562234 -0.275744804
## Leaf_Pmass -0.217543031 -0.254655437 -0.06412254 -0.70514044 -0.885531661
## FltDur      0.044618830 -0.132592326 -0.13357624 -0.05874797 -0.147231348
## Leaf_Nmass -0.434856211 -0.971646305 -0.52910745  0.35059829 -0.205267290
## Root_Nmass -0.327452541 -0.550886498 -0.96572894  0.22562513 -0.079856074
## Root_Cmass  0.099347516  0.168254073  0.33066731  0.02677610  0.100185313
## LDMC        1.000000000  0.485062621  0.33012948 -0.07020455  0.215033041
## Leaf_CN     0.485062621  1.000000000  0.55169993 -0.33396609  0.234136224
## Root_CN     0.330129481  0.551699928  1.00000000 -0.19803730  0.102393514
## Leaf_NP    -0.070204551 -0.333966095 -0.19803730  1.00000000  0.829726245
## Leaf_CP     0.215033041  0.234136224  0.10239351  0.82972624  1.000000000
## SRL        -0.190866435 -0.004185425 -0.07054222  0.02164472  0.032052800
## FltDate    -0.104362513 -0.024640552 -0.11654247  0.07958522  0.079064142
##                     SRL     FltDate
## Leaf_Cmass -0.269651660  0.03411447
## SeedMass   -0.429370998 -0.29470135
## Height     -0.226394473  0.17646590
## Leaf_area  -0.390629158 -0.03012826
## SLA         0.261162529  0.12864332
## Leaf_Pmass -0.033872442 -0.01149970
## FltDur     -0.145614371 -0.03573571
## Leaf_Nmass -0.040371456  0.04398669
## Root_Nmass  0.061461700  0.12121725
## Root_Cmass -0.088542350 -0.02448182
## LDMC       -0.190866435 -0.10436251
## Leaf_CN    -0.004185425 -0.02464055
## Root_CN    -0.070542221 -0.11654247
## Leaf_NP     0.021644716  0.07958522
## Leaf_CP     0.032052800  0.07906414
## SRL         1.000000000  0.39428523
## FltDate     0.394285228  1.00000000
## 
## $corrPos
##          xName      yName  x  y         corr p.value
## 1   Leaf_Cmass   SeedMass  1 16  0.229780000       0
## 2   Leaf_Cmass     Height  1 15  0.384636473       0
## 3   Leaf_Cmass  Leaf_area  1 14  0.206554780       0
## 4   Leaf_Cmass        SLA  1 13 -0.189982370       1
## 5   Leaf_Cmass Leaf_Pmass  1 12 -0.059703994       1
## 6   Leaf_Cmass     FltDur  1 11 -0.041530095       1
## 7   Leaf_Cmass Leaf_Nmass  1 10  0.082867433       1
## 8   Leaf_Cmass Root_Nmass  1  9 -0.149988873       1
## 9   Leaf_Cmass Root_Cmass  1  8  0.045301417       1
## 10  Leaf_Cmass       LDMC  1  7  0.303072716       0
## 11  Leaf_Cmass    Leaf_CN  1  6  0.134167058       1
## 12  Leaf_Cmass    Root_CN  1  5  0.147579584       1
## 13  Leaf_Cmass    Leaf_NP  1  4  0.122588338       1
## 14  Leaf_Cmass    Leaf_CP  1  3  0.199991857       1
## 15  Leaf_Cmass        SRL  1  2 -0.269651660       0
## 16  Leaf_Cmass    FltDate  1  1  0.034114473       1
## 17    SeedMass     Height  2 15  0.361121985       0
## 18    SeedMass  Leaf_area  2 14  0.416619763       0
## 19    SeedMass        SLA  2 13 -0.159402850       1
## 20    SeedMass Leaf_Pmass  2 12 -0.020792890       1
## 21    SeedMass     FltDur  2 11 -0.024432307       1
## 22    SeedMass Leaf_Nmass  2 10  0.228824916       0
## 23    SeedMass Root_Nmass  2  9  0.091017014       1
## 24    SeedMass Root_Cmass  2  8 -0.047105850       1
## 25    SeedMass       LDMC  2  7  0.109641991       1
## 26    SeedMass    Leaf_CN  2  6 -0.200529948       1
## 27    SeedMass    Root_CN  2  5 -0.100710610       1
## 28    SeedMass    Leaf_NP  2  4  0.143144732       1
## 29    SeedMass    Leaf_CP  2  3  0.034554412       1
## 30    SeedMass        SRL  2  2 -0.429370998       0
## 31    SeedMass    FltDate  2  1 -0.294701349       0
## 32      Height  Leaf_area  3 14  0.452299592       0
## 33      Height        SLA  3 13 -0.164129207       1
## 34      Height Leaf_Pmass  3 12  0.075885741       1
## 35      Height     FltDur  3 11 -0.211012698       0
## 36      Height Leaf_Nmass  3 10  0.067455833       1
## 37      Height Root_Nmass  3  9 -0.016426940       1
## 38      Height Root_Cmass  3  8  0.034900117       1
## 39      Height       LDMC  3  7  0.301659012       0
## 40      Height    Leaf_CN  3  6  0.009434968       1
## 41      Height    Root_CN  3  5  0.030360449       1
## 42      Height    Leaf_NP  3  4 -0.011682975       1
## 43      Height    Leaf_CP  3  3 -0.006257259       1
## 44      Height        SRL  3  2 -0.226394473       0
## 45      Height    FltDate  3  1  0.176465902       1
## 46   Leaf_area        SLA  4 13  0.136825665       1
## 47   Leaf_area Leaf_Pmass  4 12  0.203112601       1
## 48   Leaf_area     FltDur  4 11  0.108552587       1
## 49   Leaf_area Leaf_Nmass  4 10  0.269333000       0
## 50   Leaf_area Root_Nmass  4  9  0.050510285       1
## 51   Leaf_area Root_Cmass  4  8  0.039292500       1
## 52   Leaf_area       LDMC  4  7 -0.003080587       1
## 53   Leaf_area    Leaf_CN  4  6 -0.223032542       0
## 54   Leaf_area    Root_CN  4  5 -0.040347331       1
## 55   Leaf_area    Leaf_NP  4  4 -0.011125417       1
## 56   Leaf_area    Leaf_CP  4  3 -0.143819859       1
## 57   Leaf_area        SRL  4  2 -0.390629158       0
## 58   Leaf_area    FltDate  4  1 -0.030128255       1
## 59         SLA Leaf_Pmass  5 12  0.302032989       0
## 60         SLA     FltDur  5 11  0.130339323       1
## 61         SLA Leaf_Nmass  5 10  0.517475153       0
## 62         SLA Root_Nmass  5  9  0.294085800       0
## 63         SLA Root_Cmass  5  8 -0.076399318       1
## 64         SLA       LDMC  5  7 -0.478965555       0
## 65         SLA    Leaf_CN  5  6 -0.537662192       0
## 66         SLA    Root_CN  5  5 -0.291195632       0
## 67         SLA    Leaf_NP  5  4  0.045622342       1
## 68         SLA    Leaf_CP  5  3 -0.275744804       0
## 69         SLA        SRL  5  2  0.261162529       0
## 70         SLA    FltDate  5  1  0.128643321       1
## 71  Leaf_Pmass     FltDur  6 11  0.118516920       1
## 72  Leaf_Pmass Leaf_Nmass  6 10  0.260748983       0
## 73  Leaf_Pmass Root_Nmass  6  9  0.048903029       1
## 74  Leaf_Pmass Root_Cmass  6  8 -0.046300479       1
## 75  Leaf_Pmass       LDMC  6  7 -0.217543031       0
## 76  Leaf_Pmass    Leaf_CN  6  6 -0.254655437       0
## 77  Leaf_Pmass    Root_CN  6  5 -0.064122544       1
## 78  Leaf_Pmass    Leaf_NP  6  4 -0.705140444       0
## 79  Leaf_Pmass    Leaf_CP  6  3 -0.885531661       0
## 80  Leaf_Pmass        SRL  6  2 -0.033872442       1
## 81  Leaf_Pmass    FltDate  6  1 -0.011499702       1
## 82      FltDur Leaf_Nmass  7 10  0.132386569       1
## 83      FltDur Root_Nmass  7  9  0.138905079       1
## 84      FltDur Root_Cmass  7  8 -0.010820221       1
## 85      FltDur       LDMC  7  7  0.044618830       1
## 86      FltDur    Leaf_CN  7  6 -0.132592326       1
## 87      FltDur    Root_CN  7  5 -0.133576245       1
## 88      FltDur    Leaf_NP  7  4 -0.058747966       1
## 89      FltDur    Leaf_CP  7  3 -0.147231348       1
## 90      FltDur        SRL  7  2 -0.145614371       1
## 91      FltDur    FltDate  7  1 -0.035735706       1
## 92  Leaf_Nmass Root_Nmass  8  9  0.528766380       0
## 93  Leaf_Nmass Root_Cmass  8  8 -0.156970145       1
## 94  Leaf_Nmass       LDMC  8  7 -0.434856211       0
## 95  Leaf_Nmass    Leaf_CN  8  6 -0.971646305       0
## 96  Leaf_Nmass    Root_CN  8  5 -0.529107450       0
## 97  Leaf_Nmass    Leaf_NP  8  4  0.350598288       0
## 98  Leaf_Nmass    Leaf_CP  8  3 -0.205267290       1
## 99  Leaf_Nmass        SRL  8  2 -0.040371456       1
## 100 Leaf_Nmass    FltDate  8  1  0.043986687       1
## 101 Root_Nmass Root_Cmass  9  8 -0.083593831       1
## 102 Root_Nmass       LDMC  9  7 -0.327452541       0
## 103 Root_Nmass    Leaf_CN  9  6 -0.550886498       0
## 104 Root_Nmass    Root_CN  9  5 -0.965728939       0
## 105 Root_Nmass    Leaf_NP  9  4  0.225625127       0
## 106 Root_Nmass    Leaf_CP  9  3 -0.079856074       1
## 107 Root_Nmass        SRL  9  2  0.061461700       1
## 108 Root_Nmass    FltDate  9  1  0.121217248       1
## 109 Root_Cmass       LDMC 10  7  0.099347516       1
## 110 Root_Cmass    Leaf_CN 10  6  0.168254073       1
## 111 Root_Cmass    Root_CN 10  5  0.330667308       0
## 112 Root_Cmass    Leaf_NP 10  4  0.026776102       1
## 113 Root_Cmass    Leaf_CP 10  3  0.100185313       1
## 114 Root_Cmass        SRL 10  2 -0.088542350       1
## 115 Root_Cmass    FltDate 10  1 -0.024481823       1
## 116       LDMC    Leaf_CN 11  6  0.485062621       0
## 117       LDMC    Root_CN 11  5  0.330129481       0
## 118       LDMC    Leaf_NP 11  4 -0.070204551       1
## 119       LDMC    Leaf_CP 11  3  0.215033041       0
## 120       LDMC        SRL 11  2 -0.190866435       1
## 121       LDMC    FltDate 11  1 -0.104362513       1
## 122    Leaf_CN    Root_CN 12  5  0.551699928       0
## 123    Leaf_CN    Leaf_NP 12  4 -0.333966095       0
## 124    Leaf_CN    Leaf_CP 12  3  0.234136224       0
## 125    Leaf_CN        SRL 12  2 -0.004185425       1
## 126    Leaf_CN    FltDate 12  1 -0.024640552       1
## 127    Root_CN    Leaf_NP 13  4 -0.198037303       1
## 128    Root_CN    Leaf_CP 13  3  0.102393514       1
## 129    Root_CN        SRL 13  2 -0.070542221       1
## 130    Root_CN    FltDate 13  1 -0.116542472       1
## 131    Leaf_NP    Leaf_CP 14  3  0.829726245       0
## 132    Leaf_NP        SRL 14  2  0.021644716       1
## 133    Leaf_NP    FltDate 14  1  0.079585223       1
## 134    Leaf_CP        SRL 15  2  0.032052800       1
## 135    Leaf_CP    FltDate 15  1  0.079064142       1
## 136        SRL    FltDate 16  1  0.394285228       0
## 
## $arg
## $arg$type
## [1] "lower"
# Perform Trait Network (TN) analysis
Tn_result <- TN(traits_matrix = PFF_traits, rThres = 0.2, pThres = 0.05,method = "pearson")
Tn_result
## IGRAPH a50d487 UNW- 17 48 -- 
## + attr: name (v/c), weight (e/n), correlation (e/n)
## + edges from a50d487 (vertex names):
##  [1] Height   --Leaf_area  Height   --LDMC       Height   --SRL       
##  [4] Height   --SeedMass   Height   --FltDur     Height   --Leaf_Cmass
##  [7] Leaf_area--SRL        Leaf_area--SeedMass   Leaf_area--Leaf_Cmass
## [10] Leaf_area--Leaf_Nmass Leaf_area--Leaf_CN    LDMC     --SLA       
## [13] LDMC     --Leaf_Cmass LDMC     --Leaf_Nmass LDMC     --Leaf_CN   
## [16] LDMC     --Leaf_Pmass LDMC     --Leaf_CP    LDMC     --Root_Nmass
## [19] LDMC     --Root_CN    SLA      --SRL        SLA      --Leaf_Nmass
## [22] SLA      --Leaf_CN    SLA      --Leaf_Pmass SLA      --Leaf_CP   
## + ... omitted several edges
# Calculate network metrics for the trait network
TN_metrics(Tn_result)
## $node
##            degree  closeness betweenness clustering_coefficient
## Height          6 0.11869962          16              0.4666667
## Leaf_area       6 0.11573501           8              0.5333333
## LDMC            9 0.13922700          26              0.4722222
## SLA             8 0.12842194          14              0.5714286
## SRL             6 0.12375593          12              0.4666667
## SeedMass        6 0.11342243          11              0.5333333
## FltDate         2 0.08277376           0              1.0000000
## FltDur          1 0.08628264           0              0.0000000
## Leaf_Cmass      5 0.12558547           4              0.7000000
## Leaf_Nmass      9 0.12265464           7              0.5000000
## Leaf_CN         9 0.11545889           9              0.5833333
## Leaf_Pmass      6 0.12327490           0              0.8000000
## Leaf_NP         5 0.09462849           0              0.7000000
## Leaf_CP         5 0.11396509           2              0.8000000
## Root_Cmass      1 0.06839341           0              0.0000000
## Root_Nmass      6 0.10360997           7              0.8000000
## Root_CN         6 0.10350594          15              0.6666667
## 
## $global
##   edge_density diameter avg_path_length avg_clustering_coefficient modularity
## 1    0.3529412 1.277311        0.583704                  0.5845588  0.2777778
# Create visualization plots of the trait network
par(mfrow=c(1,2))
# Style 1
TN_plot(Tn_result, style = 1,vertex.size = 10,vertex.label.cex = 0.6)
# Style 2
TN_plot(Tn_result, style = 2,vertex.size = 20,vertex.label.cex = 0.6)