
Trait-gradient analysis with the two choices of weights
Source:R/trait_gradient.R
trait_gradient_weights.RdRuns trait_gradient() with each combination of weights of the site means and of the
species means (abundance or occurrence) and puts the values of \(\beta\) and
\(\alpha\) of each species side by side, with the correlations among the combinations.
Large differences mean that the result depends on the dominant species.
Arguments
- data
Data frame with one row per individual or per population (species in a site), such as from
sample_individuals(). Rows of one population are averaged.- abundance
Name of the column with abundances (needed here).
- ...
Further arguments to
trait_gradient().
Value
A list with beta and alpha, data frames with one row per species and one column
per combination (abundance/abundance, abundance/occurrence, occurrence/abundance,
occurrence/occurrence, sites first), and correlation, the correlations of
\(\beta\) and of \(\alpha\) between each combination and the first.
See also
Other trait variation among individuals:
community_index(),
drift_test(),
neighbour_metrics,
nested_variance(),
null_intervals(),
plot.mc_trait_gradient(),
plot.nested_variance(),
plot.trait_flex(),
plot.trait_rarefaction(),
plot.tstats(),
plot_population_traits(),
population_shifts(),
sample_individuals(),
subsample_individuals(),
trait_densities(),
trait_flex(),
trait_gradient(),
trait_gradient_bayes(),
trait_gradient_phylo(),
trait_gradient_test(),
trait_rarefaction(),
tstats(),
tstats_summary()
Examples
set.seed(1)
tree <- treeshapesim::sim_tree_shape(20)
sim <- simulate_metacommunity(landscape_implicit(15), species_traits(tree),
competition_matrix(tree, "none"), n_steps = 100,
seed_steps = 1:5)
ind <- sample_individuals(sim, n = 5, intraspecific_sd = 1)
trait_gradient_weights(ind, abundance = "abundance")$correlation
#> weights beta alpha
#> 1 abundance/abundance 1.0000000 1.0000000
#> 2 abundance/occurrence 0.7747809 0.9483062
#> 3 occurrence/abundance 0.7130104 0.9773422
#> 4 occurrence/occurrence 0.3973584 0.9702739