LBNbiom.method.counts: Use the LBN and LB methods to calculate the slope of the...

View source: R/fitting.R

LBNbiom.method.countsR Documentation

Use the LBN and LB methods to calculate the slope of the biomass size spectra for count data

Description

Use the log-binning with normalisation technique to calculate the slope of the biomass size spectra, for count data. Slope is from fitting a linear regression of ⁠log10(normalised biomass in bin)⁠ against ⁠log10(midpoint of bin)⁠. Bins can be defined by user, else are created to double in size. Also calculates slope for biomasses not being normalised (LB method).

Usage

LBNbiom.method.counts(valCounts, binBreaks = NULL, lowerCutOff = 0)

Arguments

valCounts

valCounts: data.frame (or tbl_df) with columns bodyMass and Number, which is the count for each body mass. bodyMass can represent midpoints, say, of existing bins, or be the actual species-specific converted-to-bodyMass values. Number can be non-integer, which can arise from standardising, say, trawl data scaled to be per hour.

binBreaks

breaks for the bins to be used to bin the data and then fit the regression. If not provided then it calculates them as bin widths that double in size that encompass the data, resulting in binBreaks that are powers of 2, giving ..., 0.25, 0.5, 1, 2, 4, 8, 16,... as necessary.

lowerCutOff

body mass value representing the lower cut off for the range being fit.

Value

list containing:

  • valCounts2: dataframe valCounts with extra columns binMin, the minimum of the bin into which that bodyMass falls, and biomass, the biomass corresponding to bodyMass * Number.

  • binVals: dataframe with a row for each bin and columns:

    • binMid, binMin, binMax, binWidth: midpoint, minimum, maximum, and width, respectively, of the bin

    • totalBiom: total biomass in that bin

    • totalBiomNorm: normalised total biomass in that bin, defined as totalBiom / binWidth

    • log10....: log10 of some of the above quantities

  • norm.lm: lm() result of the linear regression fit using normalised biomass in each bin

  • norm.slope: slope of the linear regression fit using normalised biomass in each bin

  • unNorm.lm: lm() result of the linear regression fit when not normalising the biomass in each bin

  • ⁠unNorm.slope:⁠ slope of the linear regression fit when not normalising the biomass in each bin

Author(s)

Andrew Edwards


andrew-edwards/sizeSpectra documentation built on June 28, 2023, 7:09 p.m.