Function to compare an observed trait hypervolume at a site to that of a random subset of species from the dataset. It uses the db_FD function from the FD package (Laliberté & Legendre, 2010, ECOLOGY). It outputs the putative ecological process following Lamanna et al. (2014, PNAS).
The file phytosweden.RData contains a simulated abundance table and the trait table used in Redondo et al. (2018, ISME) as an example to run the env_fil function.