R/summary_methods.R
getCommunitySlope.Rd
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 = 1:nrow(sim@params@species_params), biomass = TRUE, ... )
sim | A MizerSim object |
---|---|
species | Numeric or character vector of species to include in the calculation. |
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()
if (FALSE) { data(NS_species_params_gears) data(inter) params <- newMultispeciesParams(NS_species_params_gears, inter) sim <- project(params, effort=1, t_max=40, dt = 1, t_save = 1) # Slope based on biomass, using all species and sizes slope_biomass <- getCommunitySlope(sim) # Slope based on numbers, using all species and sizes slope_numbers <- getCommunitySlope(sim, biomass=FALSE) # Slope based on biomass, using all species and sizes between 10g and 1000g slope_biomass <- getCommunitySlope(sim, min_w = 10, max_w = 1000) # 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(sim, species = dem_species, min_w = 10, max_w = 1000) }