View source: R/summary_methods.R
getCommunitySlope | R Documentation |
Calculates the slope of the community abundance through time by performing a linear regression on the logged total numerical abundance at weight and logged weights (natural logs, not log to base 10, are used). You can specify minimum and maximum weight or length range for the species. Lengths take precedence over weights (i.e. if both min_l and min_w are supplied, only min_l will be used). You can also specify the species to be used in the calculation.
getCommunitySlope(sim, species = NULL, biomass = TRUE, ...)
sim |
A MizerSim object |
species |
The species to be selected. Optional. By default all target species are selected. A vector of species names, or a numeric vector with the species indices, or a logical vector indicating for each species whether it is to be selected (TRUE) or not. |
biomass |
Boolean. If TRUE (default), the abundance is based on biomass, if FALSE the abundance is based on numbers. |
... |
Arguments passed on to
|
A data.frame with four columns: time step, slope, intercept and the coefficient of determination R^2.
Other functions for calculating indicators:
getMeanMaxWeight()
,
getMeanWeight()
,
getProportionOfLargeFish()
# Slope based on biomass, using all species and sizes
slope_biomass <- getCommunitySlope(NS_sim)
slope_biomass[1, ] # in 1976
slope_biomass[idxFinalT(NS_sim), ] # in 2010
# Slope based on numbers, using all species and sizes
slope_numbers <- getCommunitySlope(NS_sim, biomass = FALSE)
slope_numbers[1, ] # in 1976
# Slope based on biomass, using all species and sizes between 10g and 1000g
slope_biomass <- getCommunitySlope(NS_sim, min_w = 10, max_w = 1000)
slope_biomass[1, ] # in 1976
# Slope based on biomass, using only demersal species and
# sizes between 10g and 1000g
dem_species <- c("Dab","Whiting", "Sole", "Gurnard", "Plaice",
"Haddock", "Cod", "Saithe")
slope_biomass <- getCommunitySlope(NS_sim, species = dem_species,
min_w = 10, max_w = 1000)
slope_biomass[1, ] # in 1976
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.