This function calculates trait diversity per cell (sensu Leps et al 2006)
References
De Bello, F., Lepš, J. and Sebastià, M.-T. (2006), Variations in species and functional plant diversity along climatic and grazing gradients. Ecography, 29: 801-810. https://doi.org/10.1111/j.2006.0906-7590.04683.x
Examples
if (FALSE) { # \dontrun{
# mock simulation state
space <- system.file("extdata/SouthAmerica/species_and_spaces/space_t_2.rds", package = "gen3sis2") |> readRDS()
all_species <- system.file("extdata/SouthAmerica/species_and_spaces/species_t_2.rds", package = "gen3sis2") |> readRDS()
data <- list(
space = space,
all_species = all_species
)
get_trait_diversity(data$all_species)[1:5,]
} # }