Rarefaction-like analyses to calculate saturation of biological diversity variables.
This code repository contains an R script used in Karbstein et al. 2020 (https://onlinelibrary.wiley.com/doi/abs/10.1002/ece3.6255) to calculate saturation of diversity variables per population/location (intraspecific functional trait diversity, within-habitat heterogeneity, and genetic diversity based on microsatellite/SSR data (rarefaction-like analyses).
This is an exemplary script to perform this type of analysis. You will need to adapt the directory paths to your system or install the required packages. Most of the datasets used are available on Dryad (https://doi.org/10.5061/dryad.n02v6wwtd). Data from the study by Karbstein et al. (2020) are also given here (test folder = try the R script on your own based on the provided datasets, results folder = output of the function). Please do not hesitate to contact me if you have any suggestions for improvement.
If you use the code, please cite:
Karbstein, K, Prinz, K., Hellwig, F., Römermann, C. Plant intraspecific functional trait variation is related to within-habitat heterogeneity and genetic diversity in Trifolium montanum L. Ecology and Evolution, 2020; 10; 5015-5033. https://doi.org/10.1002/ece3.6255