MultiTraits_tutorial

The MultiTraits package is a powerful tool for analyzing and visualizing multidimensional traits in plants. It provides a comprehensive set of functions for various trait-based ecological analyses, including CSR strategy analysis, LHS strategy analysis, niche periodicity table analysis, and trait network analysis. This vignette will guide you through the installation process and demonstrate the main functions of the package using example datasets.

Installation

From GitHub (development version)

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

Main Functions

Function Description
Data
PFF Plant Functional Traits Dataset from Ponderosa Pine Forests Flora
WH Wetland Herbaceous Plant Traits Dataset
CSR
CSR_strategy() Calculate CSR (Competition-Stress-Ruderal) Strategy
CSR() Calculate CSR strategy for multiple plant species
CSR_plot() Create a ternary plot of CSR strategies
LHS
LHS() Calculate LHS (Leaf-Height-Seed) Strategy
LHS_plot() Generate a 3D scatterplot of plant traits
LHS_strategy_scheme() Create a table of Leaf-Height-Seed (LHS) strategy types
NPT
NPT() Perform ‘PCA of PCAs’ for ecological niche periodicity
NPT_plot() Plot results from nested principal component analysis
TN
TN_corr() Calculate and Visualize Plant Trait Correlation Network
TN() Generate Plant Trait Network
TN_plot() Calculate Node and Global Metrics for Trait Networks
TN_metrics() Plot Trait Network Graph

Example Datasets

The MultiTraits package includes two example datasets: PFF and WH. Let’s load the package and examine these datasets:

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)
data(WH)

# View the structure of the datasets
str(PFF)
## 'data.frame':    133 obs. of  20 variables:
##  $ family    : chr  "Asteraceae" "Asteraceae" "Poaceae" "Asteraceae" ...
##  $ species   : chr  "Achillea millefolium" "Agoseris glauca" "Agropyron desertorum" "Ambrosia psilostachya" ...
##  $ Height    : int  14 12 26 44 1 2 1 8 15 7 ...
##  $ Leaf_area : num  240 520 290 490 51 66 30 32 40 20 ...
##  $ LDMC      : int  27 17 42 20 14 27 29 27 15 43 ...
##  $ SLA       : int  8 20 9 16 31 13 19 13 22 7 ...
##  $ SRL       : int  35 56 99 73 80 27 30 50 29 51 ...
##  $ SeedMass  : num  0.14 2.53 0.388 5.896 0.128 ...
##  $ FltDate   : int  197 213 198 243 182 182 182 182 197 182 ...
##  $ FltDur    : int  152 183 91 122 182 122 122 182 152 182 ...
##  $ k_value   : num  1.7 1.1 NA 2.23 NA 0.54 0.65 1.04 1.33 0.58 ...
##  $ Leaf_Cmass: num  41.2 42.6 41.5 38.4 40.8 ...
##  $ Leaf_Nmass: num  1.92 1.72 2.32 2.32 1.95 1.53 1.59 1.74 1.8 0.99 ...
##  $ Leaf_CN   : int  22 25 18 17 22 30 26 25 25 41 ...
##  $ Leaf_Pmass: num  0.36 0.39 0.06 0.25 0.29 0.18 0.17 0.13 0.13 0.06 ...
##  $ Leaf_NP   : int  6 4 52 14 7 9 10 14 16 18 ...
##  $ Leaf_CP   : int  114 109 1021 224 131 252 266 341 387 759 ...
##  $ Root_Cmass: num  41 45.9 41.5 35.7 46.5 ...
##  $ Root_Nmass: num  0.48 0.89 1.61 1.29 1.23 0.55 0.41 0.96 0.93 0.66 ...
##  $ Root_CN   : int  85 52 26 28 38 65 101 47 47 56 ...
str(WH)
## 'data.frame':    46 obs. of  23 variables:
##  $ Species: chr  "Acorus calamus" "Alisma triviale" "Butomus umbellatus " "Calla palustris" ...
##  $ species: chr  "AcoCal" "AliTri" "ButUmb" "CalPal" ...
##  $ ROH    : chr  "P" "S" "S" "S" ...
##  $ Height : num  67.4 33.5 52.5 18.8 42.4 64 71.8 38.5 54.4 57 ...
##  $ ShDM   : num  5377 2247 706 279 550 ...
##  $ Depth  : num  32.1 47.5 34.8 36.5 27.4 25.4 28.5 17.8 36.2 33 ...
##  $ RBD    : num  7.1 1.96 4.19 1.16 5.2 ...
##  $ RBL    : num  20.1 2.65 6.55 1.72 2.07 ...
##  $ RD_AR  : num  2.093 1.045 1.558 0.947 0.788 ...
##  $ RD_LR  : num  0.211 0.157 0.152 0.233 0.138 0.167 0.14 0.148 0.164 0.222 ...
##  $ RDMC_AR: num  0.14 0.061 0.048 0.045 0.189 0.174 0.163 0.154 0.189 0.147 ...
##  $ RDMC_LR: num  0.098 0.103 0.083 0.051 0.153 0.144 0.116 0.12 0.144 0.113 ...
##  $ SRL_AR : num  3.74 55.98 19.88 38.89 20.95 ...
##  $ SRL_LR : num  152 469 438 475 244 ...
##  $ RP_AR  : num  0.473 0.283 0.4 0.315 0.472 0.273 0.374 0.285 0.504 0.533 ...
##  $ RP_LR  : num  0.133 0.076 0.092 0.144 0.107 0.061 0.126 0.155 0.127 0.192 ...
##  $ LT     : num  3.57 0.438 3.75 0.46 0.285 0.373 1.5 0.3 1.8 0.91 ...
##  $ LDMC   : num  0.19 0.135 0.151 0.139 0.288 0.201 0.297 0.361 0.358 0.316 ...
##  $ SLA    : num  9.4 14.9 9.15 25.3 24.45 ...
##  $ LP     : num  0.581 0.277 0.563 0.457 0.237 0.266 0.35 0.228 0.529 0.087 ...
##  $ RhDMC  : num  0.368 0.291 0.316 0.21 0.295 NA 0.169 0.285 0.197 0.162 ...
##  $ RhP    : num  0.218 NA 0.145 0.431 0.409 NA 0.414 0.334 0.331 0.27 ...
##  $ LSI    : num  0.8 1 NA 0.87 NA NA 0.5 NA 0.37 0.33 ...

CSR Strategy

The CSR strategy analysis function allows you to analyze plant strategies based on the CSR (Competitive, Stress-tolerant, Ruderal) theory:

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)

LHS Strategy

The LHS strategy analysis function helps you analyze plant strategies based on the LHS (Leaf-Height-Seed) theory:

data(PFF)
pff <- PFF[, c("SLA", "Height", "SeedMass")]
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
LHS_plot(result)

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 analysis function allows you to visualize the distribution of plant traits across different environmental gradients:

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)
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)
## 
## -- Model Summary --
## 
##               Inertia Rank
## Total         0.05941     
## Unconstrained 0.05941    6
## 
## Inertia is variance
## 
## -- Eigenvalues --
## 
## Eigenvalues for unconstrained axes:
##      PC1      PC2      PC3      PC4      PC5      PC6 
## 0.018757 0.015200 0.011163 0.005438 0.004725 0.004123
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)

Trait Network

The trait network analysis function helps you explore the relationships between different plant traits:

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

## $corr
##                  SLA         LSI      SRL_AR       SRL_LR       RP_LR
## SLA      1.000000000  0.53271074  0.10460454  0.157556437 -0.19008168
## LSI      0.532710742  1.00000000  0.49637572  0.443053214 -0.25140909
## SRL_AR   0.104604538  0.49637572  1.00000000  0.512824628  0.15222024
## SRL_LR   0.157556437  0.44305321  0.51282463  1.000000000 -0.33731706
## RP_LR   -0.190081684 -0.25140909  0.15222024 -0.337317062  1.00000000
## LDMC    -0.245301019 -0.59358878 -0.44233931 -0.304198518  0.21778726
## RDMC_AR -0.215987860 -0.46840765 -0.38298795 -0.461562667  0.12377048
## RDMC_LR -0.225504898 -0.42254539 -0.17976877 -0.343261703  0.08028269
## RhDMC   -0.300311486  0.07135790 -0.29128339 -0.178306783 -0.04291417
## RBD     -0.007356992 -0.12475922 -0.49643328  0.002683378 -0.48438634
## RBL     -0.052828338 -0.07408082 -0.53246751 -0.173217684 -0.34084423
## LT      -0.572436285 -0.19075548 -0.10774556  0.129313415 -0.14961662
## LP      -0.520034486 -0.06773124  0.04899093  0.178223595 -0.16162343
## RD_LR    0.087400138  0.02791192 -0.28897427 -0.409609209  0.06157369
## ShDM    -0.071265691  0.01519414 -0.41046860 -0.137185205 -0.36021092
## RD_AR    0.075785887 -0.08153491 -0.65604933 -0.275272618 -0.32616282
## RP_AR    0.127815827 -0.09882845 -0.27359375 -0.025676250 -0.13829769
## RhP      0.137417838  0.06568404 -0.01983859  0.152094957 -0.27113751
## Height  -0.365437330 -0.43965937 -0.39230580  0.017887369 -0.25452538
## Depth   -0.119122241  0.12086840 -0.09743188  0.305742199 -0.33537557
##                LDMC     RDMC_AR     RDMC_LR       RhDMC          RBD
## SLA     -0.24530102 -0.21598786 -0.22550490 -0.30031149 -0.007356992
## LSI     -0.59358878 -0.46840765 -0.42254539  0.07135790 -0.124759223
## SRL_AR  -0.44233931 -0.38298795 -0.17976877 -0.29128339 -0.496433282
## SRL_LR  -0.30419852 -0.46156267 -0.34326170 -0.17830678  0.002683378
## RP_LR    0.21778726  0.12377048  0.08028269 -0.04291417 -0.484386337
## LDMC     1.00000000  0.64671069  0.50540518  0.28564700  0.275809649
## RDMC_AR  0.64671069  1.00000000  0.85278749  0.48774952  0.230250362
## RDMC_LR  0.50540518  0.85278749  1.00000000  0.51539916  0.059946508
## RhDMC    0.28564700  0.48774952  0.51539916  1.00000000  0.293772481
## RBD      0.27580965  0.23025036  0.05994651  0.29377248  1.000000000
## RBL      0.15104753  0.16098900 -0.04895388  0.29819072  0.740418757
## LT      -0.22008102 -0.19556756 -0.21719521  0.01741285  0.060881004
## LP      -0.27423649 -0.18044171 -0.14903845 -0.07943247 -0.080996361
## RD_LR   -0.23800308 -0.22498976 -0.39676410 -0.37335139 -0.194478212
## ShDM    -0.25774126 -0.18030805 -0.22170981 -0.10488216  0.476519923
## RD_AR   -0.02098849 -0.07435492 -0.21275400  0.05882312  0.288632820
## RP_AR    0.09201162  0.01126173 -0.11139461 -0.09815606  0.077488261
## RhP     -0.11250400 -0.15798152 -0.15599880 -0.31093912 -0.148374656
## Height   0.17933962 -0.01815980 -0.09284921  0.01997698  0.436115116
## Depth   -0.27705725 -0.52688271 -0.38210955 -0.18631515 -0.003316926
##                 RBL            LT          LP       RD_LR        ShDM
## SLA     -0.05282834 -5.724363e-01 -0.52003449  0.08740014 -0.07126569
## LSI     -0.07408082 -1.907555e-01 -0.06773124  0.02791192  0.01519414
## SRL_AR  -0.53246751 -1.077456e-01  0.04899093 -0.28897427 -0.41046860
## SRL_LR  -0.17321768  1.293134e-01  0.17822359 -0.40960921 -0.13718520
## RP_LR   -0.34084423 -1.496166e-01 -0.16162343  0.06157369 -0.36021092
## LDMC     0.15104753 -2.200810e-01 -0.27423649 -0.23800308 -0.25774126
## RDMC_AR  0.16098900 -1.955676e-01 -0.18044171 -0.22498976 -0.18030805
## RDMC_LR -0.04895388 -2.171952e-01 -0.14903845 -0.39676410 -0.22170981
## RhDMC    0.29819072  1.741285e-02 -0.07943247 -0.37335139 -0.10488216
## RBD      0.74041876  6.088100e-02 -0.08099636 -0.19447821  0.47651992
## RBL      1.00000000  8.968381e-02 -0.16557802  0.12626576  0.61490310
## LT       0.08968381  1.000000e+00  0.76527410  0.17068629  0.26300122
## LP      -0.16557802  7.652741e-01  1.00000000 -0.05223939  0.04670654
## RD_LR    0.12626576  1.706863e-01 -0.05223939  1.00000000  0.37381207
## ShDM     0.61490310  2.630012e-01  0.04670654  0.37381207  1.00000000
## RD_AR    0.61152884  1.035804e-01 -0.15169633  0.47902504  0.62791090
## RP_AR    0.24291925 -6.230699e-05 -0.13555112  0.09414819  0.25164229
## RhP     -0.17895443  1.587283e-01  0.08116432  0.30518250  0.05323982
## Height   0.42284151  5.533747e-01  0.29542530  0.05838415  0.39102066
## Depth    0.04500939  2.875720e-01  0.32653387  0.06057830  0.40621869
##               RD_AR         RP_AR         RhP      Height        Depth
## SLA      0.07578589  1.278158e-01  0.13741784 -0.36543733 -0.119122241
## LSI     -0.08153491 -9.882845e-02  0.06568404 -0.43965937  0.120868397
## SRL_AR  -0.65604933 -2.735938e-01 -0.01983859 -0.39230580 -0.097431882
## SRL_LR  -0.27527262 -2.567625e-02  0.15209496  0.01788737  0.305742199
## RP_LR   -0.32616282 -1.382977e-01 -0.27113751 -0.25452538 -0.335375569
## LDMC    -0.02098849  9.201162e-02 -0.11250400  0.17933962 -0.277057247
## RDMC_AR -0.07435492  1.126173e-02 -0.15798152 -0.01815980 -0.526882708
## RDMC_LR -0.21275400 -1.113946e-01 -0.15599880 -0.09284921 -0.382109550
## RhDMC    0.05882312 -9.815606e-02 -0.31093912  0.01997698 -0.186315152
## RBD      0.28863282  7.748826e-02 -0.14837466  0.43611512 -0.003316926
## RBL      0.61152884  2.429192e-01 -0.17895443  0.42284151  0.045009389
## LT       0.10358039 -6.230699e-05  0.15872830  0.55337472  0.287572050
## LP      -0.15169633 -1.355511e-01  0.08116432  0.29542530  0.326533875
## RD_LR    0.47902504  9.414819e-02  0.30518250  0.05838415  0.060578302
## ShDM     0.62791090  2.516423e-01  0.05323982  0.39102066  0.406218689
## RD_AR    1.00000000  4.054560e-01  0.12655262  0.38064401  0.304399380
## RP_AR    0.40545601  1.000000e+00  0.32583876  0.31572278  0.432343580
## RhP      0.12655262  3.258388e-01  1.00000000  0.36923421  0.357416668
## Height   0.38064401  3.157228e-01  0.36923421  1.00000000  0.441489386
## Depth    0.30439938  4.323436e-01  0.35741667  0.44148939  1.000000000
## 
## $corrPos
##       xName   yName  x  y          corr p.value
## 1       SLA     LSI  1 19  5.327107e-01       0
## 2       SLA  SRL_AR  1 18  1.046045e-01       1
## 3       SLA  SRL_LR  1 17  1.575564e-01       1
## 4       SLA   RP_LR  1 16 -1.900817e-01       1
## 5       SLA    LDMC  1 15 -2.453010e-01       1
## 6       SLA RDMC_AR  1 14 -2.159879e-01       1
## 7       SLA RDMC_LR  1 13 -2.255049e-01       1
## 8       SLA   RhDMC  1 12 -3.003115e-01       1
## 9       SLA     RBD  1 11 -7.356992e-03       1
## 10      SLA     RBL  1 10 -5.282834e-02       1
## 11      SLA      LT  1  9 -5.724363e-01       0
## 12      SLA      LP  1  8 -5.200345e-01       0
## 13      SLA   RD_LR  1  7  8.740014e-02       1
## 14      SLA    ShDM  1  6 -7.126569e-02       1
## 15      SLA   RD_AR  1  5  7.578589e-02       1
## 16      SLA   RP_AR  1  4  1.278158e-01       1
## 17      SLA     RhP  1  3  1.374178e-01       1
## 18      SLA  Height  1  2 -3.654373e-01       1
## 19      SLA   Depth  1  1 -1.191222e-01       1
## 20      LSI  SRL_AR  2 18  4.963757e-01       0
## 21      LSI  SRL_LR  2 17  4.430532e-01       0
## 22      LSI   RP_LR  2 16 -2.514091e-01       1
## 23      LSI    LDMC  2 15 -5.935888e-01       0
## 24      LSI RDMC_AR  2 14 -4.684077e-01       0
## 25      LSI RDMC_LR  2 13 -4.225454e-01       1
## 26      LSI   RhDMC  2 12  7.135790e-02       1
## 27      LSI     RBD  2 11 -1.247592e-01       1
## 28      LSI     RBL  2 10 -7.408082e-02       1
## 29      LSI      LT  2  9 -1.907555e-01       1
## 30      LSI      LP  2  8 -6.773124e-02       1
## 31      LSI   RD_LR  2  7  2.791192e-02       1
## 32      LSI    ShDM  2  6  1.519414e-02       1
## 33      LSI   RD_AR  2  5 -8.153491e-02       1
## 34      LSI   RP_AR  2  4 -9.882845e-02       1
## 35      LSI     RhP  2  3  6.568404e-02       1
## 36      LSI  Height  2  2 -4.396594e-01       0
## 37      LSI   Depth  2  1  1.208684e-01       1
## 38   SRL_AR  SRL_LR  3 17  5.128246e-01       0
## 39   SRL_AR   RP_LR  3 16  1.522202e-01       1
## 40   SRL_AR    LDMC  3 15 -4.423393e-01       0
## 41   SRL_AR RDMC_AR  3 14 -3.829879e-01       0
## 42   SRL_AR RDMC_LR  3 13 -1.797688e-01       1
## 43   SRL_AR   RhDMC  3 12 -2.912834e-01       1
## 44   SRL_AR     RBD  3 11 -4.964333e-01       0
## 45   SRL_AR     RBL  3 10 -5.324675e-01       0
## 46   SRL_AR      LT  3  9 -1.077456e-01       1
## 47   SRL_AR      LP  3  8  4.899093e-02       1
## 48   SRL_AR   RD_LR  3  7 -2.889743e-01       1
## 49   SRL_AR    ShDM  3  6 -4.104686e-01       0
## 50   SRL_AR   RD_AR  3  5 -6.560493e-01       0
## 51   SRL_AR   RP_AR  3  4 -2.735938e-01       1
## 52   SRL_AR     RhP  3  3 -1.983859e-02       1
## 53   SRL_AR  Height  3  2 -3.923058e-01       0
## 54   SRL_AR   Depth  3  1 -9.743188e-02       1
## 55   SRL_LR   RP_LR  4 16 -3.373171e-01       1
## 56   SRL_LR    LDMC  4 15 -3.041985e-01       1
## 57   SRL_LR RDMC_AR  4 14 -4.615627e-01       0
## 58   SRL_LR RDMC_LR  4 13 -3.432617e-01       1
## 59   SRL_LR   RhDMC  4 12 -1.783068e-01       1
## 60   SRL_LR     RBD  4 11  2.683378e-03       1
## 61   SRL_LR     RBL  4 10 -1.732177e-01       1
## 62   SRL_LR      LT  4  9  1.293134e-01       1
## 63   SRL_LR      LP  4  8  1.782236e-01       1
## 64   SRL_LR   RD_LR  4  7 -4.096092e-01       0
## 65   SRL_LR    ShDM  4  6 -1.371852e-01       1
## 66   SRL_LR   RD_AR  4  5 -2.752726e-01       1
## 67   SRL_LR   RP_AR  4  4 -2.567625e-02       1
## 68   SRL_LR     RhP  4  3  1.520950e-01       1
## 69   SRL_LR  Height  4  2  1.788737e-02       1
## 70   SRL_LR   Depth  4  1  3.057422e-01       1
## 71    RP_LR    LDMC  5 15  2.177873e-01       1
## 72    RP_LR RDMC_AR  5 14  1.237705e-01       1
## 73    RP_LR RDMC_LR  5 13  8.028269e-02       1
## 74    RP_LR   RhDMC  5 12 -4.291417e-02       1
## 75    RP_LR     RBD  5 11 -4.843863e-01       0
## 76    RP_LR     RBL  5 10 -3.408442e-01       1
## 77    RP_LR      LT  5  9 -1.496166e-01       1
## 78    RP_LR      LP  5  8 -1.616234e-01       1
## 79    RP_LR   RD_LR  5  7  6.157369e-02       1
## 80    RP_LR    ShDM  5  6 -3.602109e-01       1
## 81    RP_LR   RD_AR  5  5 -3.261628e-01       1
## 82    RP_LR   RP_AR  5  4 -1.382977e-01       1
## 83    RP_LR     RhP  5  3 -2.711375e-01       1
## 84    RP_LR  Height  5  2 -2.545254e-01       1
## 85    RP_LR   Depth  5  1 -3.353756e-01       1
## 86     LDMC RDMC_AR  6 14  6.467107e-01       0
## 87     LDMC RDMC_LR  6 13  5.054052e-01       0
## 88     LDMC   RhDMC  6 12  2.856470e-01       1
## 89     LDMC     RBD  6 11  2.758096e-01       1
## 90     LDMC     RBL  6 10  1.510475e-01       1
## 91     LDMC      LT  6  9 -2.200810e-01       1
## 92     LDMC      LP  6  8 -2.742365e-01       1
## 93     LDMC   RD_LR  6  7 -2.380031e-01       1
## 94     LDMC    ShDM  6  6 -2.577413e-01       1
## 95     LDMC   RD_AR  6  5 -2.098849e-02       1
## 96     LDMC   RP_AR  6  4  9.201162e-02       1
## 97     LDMC     RhP  6  3 -1.125040e-01       1
## 98     LDMC  Height  6  2  1.793396e-01       1
## 99     LDMC   Depth  6  1 -2.770572e-01       1
## 100 RDMC_AR RDMC_LR  7 13  8.527875e-01       0
## 101 RDMC_AR   RhDMC  7 12  4.877495e-01       0
## 102 RDMC_AR     RBD  7 11  2.302504e-01       1
## 103 RDMC_AR     RBL  7 10  1.609890e-01       1
## 104 RDMC_AR      LT  7  9 -1.955676e-01       1
## 105 RDMC_AR      LP  7  8 -1.804417e-01       1
## 106 RDMC_AR   RD_LR  7  7 -2.249898e-01       1
## 107 RDMC_AR    ShDM  7  6 -1.803080e-01       1
## 108 RDMC_AR   RD_AR  7  5 -7.435492e-02       1
## 109 RDMC_AR   RP_AR  7  4  1.126173e-02       1
## 110 RDMC_AR     RhP  7  3 -1.579815e-01       1
## 111 RDMC_AR  Height  7  2 -1.815980e-02       1
## 112 RDMC_AR   Depth  7  1 -5.268827e-01       0
## 113 RDMC_LR   RhDMC  8 12  5.153992e-01       0
## 114 RDMC_LR     RBD  8 11  5.994651e-02       1
## 115 RDMC_LR     RBL  8 10 -4.895388e-02       1
## 116 RDMC_LR      LT  8  9 -2.171952e-01       1
## 117 RDMC_LR      LP  8  8 -1.490384e-01       1
## 118 RDMC_LR   RD_LR  8  7 -3.967641e-01       0
## 119 RDMC_LR    ShDM  8  6 -2.217098e-01       1
## 120 RDMC_LR   RD_AR  8  5 -2.127540e-01       1
## 121 RDMC_LR   RP_AR  8  4 -1.113946e-01       1
## 122 RDMC_LR     RhP  8  3 -1.559988e-01       1
## 123 RDMC_LR  Height  8  2 -9.284921e-02       1
## 124 RDMC_LR   Depth  8  1 -3.821095e-01       0
## 125   RhDMC     RBD  9 11  2.937725e-01       1
## 126   RhDMC     RBL  9 10  2.981907e-01       1
## 127   RhDMC      LT  9  9  1.741285e-02       1
## 128   RhDMC      LP  9  8 -7.943247e-02       1
## 129   RhDMC   RD_LR  9  7 -3.733514e-01       1
## 130   RhDMC    ShDM  9  6 -1.048822e-01       1
## 131   RhDMC   RD_AR  9  5  5.882312e-02       1
## 132   RhDMC   RP_AR  9  4 -9.815606e-02       1
## 133   RhDMC     RhP  9  3 -3.109391e-01       1
## 134   RhDMC  Height  9  2  1.997698e-02       1
## 135   RhDMC   Depth  9  1 -1.863152e-01       1
## 136     RBD     RBL 10 10  7.404188e-01       0
## 137     RBD      LT 10  9  6.088100e-02       1
## 138     RBD      LP 10  8 -8.099636e-02       1
## 139     RBD   RD_LR 10  7 -1.944782e-01       1
## 140     RBD    ShDM 10  6  4.765199e-01       0
## 141     RBD   RD_AR 10  5  2.886328e-01       1
## 142     RBD   RP_AR 10  4  7.748826e-02       1
## 143     RBD     RhP 10  3 -1.483747e-01       1
## 144     RBD  Height 10  2  4.361151e-01       0
## 145     RBD   Depth 10  1 -3.316926e-03       1
## 146     RBL      LT 11  9  8.968381e-02       1
## 147     RBL      LP 11  8 -1.655780e-01       1
## 148     RBL   RD_LR 11  7  1.262658e-01       1
## 149     RBL    ShDM 11  6  6.149031e-01       0
## 150     RBL   RD_AR 11  5  6.115288e-01       0
## 151     RBL   RP_AR 11  4  2.429192e-01       1
## 152     RBL     RhP 11  3 -1.789544e-01       1
## 153     RBL  Height 11  2  4.228415e-01       0
## 154     RBL   Depth 11  1  4.500939e-02       1
## 155      LT      LP 12  8  7.652741e-01       0
## 156      LT   RD_LR 12  7  1.706863e-01       1
## 157      LT    ShDM 12  6  2.630012e-01       1
## 158      LT   RD_AR 12  5  1.035804e-01       1
## 159      LT   RP_AR 12  4 -6.230699e-05       1
## 160      LT     RhP 12  3  1.587283e-01       1
## 161      LT  Height 12  2  5.533747e-01       0
## 162      LT   Depth 12  1  2.875720e-01       1
## 163      LP   RD_LR 13  7 -5.223939e-02       1
## 164      LP    ShDM 13  6  4.670654e-02       1
## 165      LP   RD_AR 13  5 -1.516963e-01       1
## 166      LP   RP_AR 13  4 -1.355511e-01       1
## 167      LP     RhP 13  3  8.116432e-02       1
## 168      LP  Height 13  2  2.954253e-01       1
## 169      LP   Depth 13  1  3.265339e-01       1
## 170   RD_LR    ShDM 14  6  3.738121e-01       0
## 171   RD_LR   RD_AR 14  5  4.790250e-01       0
## 172   RD_LR   RP_AR 14  4  9.414819e-02       1
## 173   RD_LR     RhP 14  3  3.051825e-01       1
## 174   RD_LR  Height 14  2  5.838415e-02       1
## 175   RD_LR   Depth 14  1  6.057830e-02       1
## 176    ShDM   RD_AR 15  5  6.279109e-01       0
## 177    ShDM   RP_AR 15  4  2.516423e-01       1
## 178    ShDM     RhP 15  3  5.323982e-02       1
## 179    ShDM  Height 15  2  3.910207e-01       0
## 180    ShDM   Depth 15  1  4.062187e-01       0
## 181   RD_AR   RP_AR 16  4  4.054560e-01       0
## 182   RD_AR     RhP 16  3  1.265526e-01       1
## 183   RD_AR  Height 16  2  3.806440e-01       0
## 184   RD_AR   Depth 16  1  3.043994e-01       1
## 185   RP_AR     RhP 17  3  3.258388e-01       1
## 186   RP_AR  Height 17  2  3.157228e-01       1
## 187   RP_AR   Depth 17  1  4.323436e-01       0
## 188     RhP  Height 18  2  3.692342e-01       1
## 189     RhP   Depth 18  1  3.574167e-01       1
## 190  Height   Depth 19  1  4.414894e-01       0
## 
## $arg
## $arg$type
## [1] "lower"
Tn_result <- TN(traits_matrix = WH, rThres = 0.2, pThres = 0.05)
TN_metrics(Tn_result)
## $node
##         degree  closeness betweenness clustering_coefficient
## Height       8 0.07812990          46              0.3928571
## ShDM         7 0.06930042           9              0.5238095
## Depth        5 0.06437432           9              0.2000000
## RBD          5 0.05927325          17              0.6000000
## RBL          5 0.05689054           0              0.9000000
## RD_AR        6 0.06172718          11              0.4666667
## RD_LR        4 0.06175661           9              0.1666667
## RDMC_AR      7 0.06546688          12              0.3809524
## RDMC_LR      5 0.05504807           9              0.3000000
## SRL_AR       9 0.07514325          24              0.4166667
## SRL_LR       4 0.05941401           4              0.5000000
## RP_AR        2 0.04878005           0              0.0000000
## RP_LR        1 0.03983178           0                    NaN
## LT           3 0.04963639           9              0.3333333
## LDMC         4 0.05695803           3              0.6666667
## SLA          3 0.04582727           7              0.3333333
## LP           2 0.03456032           0              1.0000000
## RhDMC        2 0.04584791           0              1.0000000
## LSI          6 0.06764199          23              0.4000000
## 
## $global
##   edge_density diameter avg_path_length avg_clustering_coefficient modularity
## 1    0.2573099  2.23915        1.005394                  0.4433498  0.3055269
TN_plot(Tn_result, style = 1)