View source: R/trait_fit_distributions.R
trait_fit_distributions | R Documentation |
Function to fit parametric distributions for each species-by-trait combination at the finest scale of the user-supplied hierarchy. This function returns a tibble containing the fitted parameters.
trait_fit_distributions(filled_traits, distribution_type = "normal")
filled_traits |
output from the trait_fill function. |
distribution_type |
the type of statistical distribution to use. Character or named list. Currently accepts "normal","lognormal", and "beta". |
The distributions can either be a single distribution type which is
used for all traits, or traits can be assigned specific distributions types
by supplying the function with a named vector of traits, e.g.
c(height = "normal", mass = "lognormal"))
.
a tibble containing fitted distribution parameters for each trait in each species for each plot.
library(dplyr)
data(community)
data(trait)
filled_traits <- trait_fill(
comm = community |>
filter(PlotID %in% c("A", "B")),
traits = trait,
scale_hierarchy = c("Site", "PlotID"),
taxon_col = "Taxon", value_col = "Value",
trait_col = "Trait", abundance_col = "Cover"
)
fitted_distributions <- trait_fit_distributions(
filled_traits = filled_traits,
distribution_type = "normal"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.