    
Paper: Anthropogenic impacts on threatened species erode functional diversity in chelonians and crocodilians
Author: Roberto C. Rodríguez-Caro
Email: r.rodriguez@umh.es
Date: 01/02/2023

#Data information
    
    - Datasets -
imputed_final.txt : Dataset with the traits used in the imputation approach. Adult survival (Sa), juvenile survival (Sj), maximum lifespan (ML), age at sexual maturity (Lα), mean of number of clutches per year (CN), clutch size (CS), incubation time (G), body length (TL) and female body mass.
final_dataset.txt : Dataset with the taxonomic information,  scores of the phylogenetic PCA corrected by body mass (just PC1 and PC2), the information of the threats (0,1, NA) and the conservations status by IUCN
loadings.csv :  All loadings of the phylogenetic PCA corrected by body mass
scores.scv : All scores of the phylogenetic PCA corrected by body mass

Note, to use the code, it would necessary to use the phylogenetic tree from Colston et al. (2020). BMC Evol. Biol. The tree file is    "archosauromorpha_ML_Phylogeny.tre" and it is available in DataDryad repository (https://datadryad.org/stash/dataset/doi:10.5061%2Fdryad.h19t7b2)


    - Scripts - 
1_imputation of trait with phylomice.R : Imputation of life history traits using phylomice using "mice.impute.phnorm.R" and "mice.impute.phpmm.R"
2_pPCA corrected by BM.R : Estimate Phylogenetic Principal Component Analysis (pPCA) corrected by body mass using the imputed data
3_TPD.R : Estimate Trait Probability Density (TPD) based on Carmona et al. (2021). Ecology.
4_GAM.R : Run GAM to explore the reduction of functional life history strategies by UICN status and threats, based on Carmona et al. (2021). Ecology.
5_Simulations.R : Simulations to estimate the reduction of functional life history strategies according the number of lost species (using IUCN status and threats), based on Toussaint et al. (2021). Nat. Comms.