NPT | R Documentation |
This function conducts a ‘PCA of PCAs’ to analyze ecological niche periodicity based on multiple trait dimensions.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.