generate_cor_traits.Rd
This function generates a matrix of traits based on the given number of patches, species, the number of "additional" traits with a given correlation coefficient. The first trait is always uniform between 1 and the number of patches provided. Then the other traits are generated correlated to this first one. In the end all the traits are scaled between 1 and the number of patches.
generate_cor_traits(
number_patches,
number_species,
number_other = 9,
cor_coef = 0.7,
min_value = 1
)
a numeric value giving the total number of patches
a numeric value giving the total number of species to simulate (number of rows in the trait tables)
a numeric value giving the number of additional traits to generate in addition to the trait correlated to the number of patches
a numeric value giving the correlation coefficient between the first trait and the other ones
a minimum trait value
a matrix of traits with species in rows and traits in columns
traits <- generate_cor_traits(25, 100, 3, 0.3)