LBNbiom.method: Fit biomass size spectrum with the LBNbiom and LBbiom methods

View source: R/fitting.R

LBNbiom.methodR Documentation

Fit biomass size spectrum with the LBNbiom and LBbiom methods

Description

Use the log-binning with normalisation technique (LBNbiom method) to calculate the slope of the biomass size spectra. 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 the LBbiom method, for which biomasses are not normalised.

Usage

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

Arguments

bodyMass

vector of individual body masses

counts

dataframe (or array) with first column being a body mass value, and second column being the counts of the number of individuals for that body mass. Only bodyMass or counts can be specified.

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 (with breaks that are powers of 2) that encompass the data, resulting in binBreaks ..., 0.25, 0.5, 1, 2, 4, 8, 16,.... as necessary.

lowerCutOff

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

Value

list containing:

  • indiv: dataframe with a row for each bodyMass value and with columns:

    • 'x': original bodyMass values.

    • binMid, binMin, binMax, binWidth: midpoint, minimum, maximum, and width, respectively, of the bin within which the x value falls. If indiv has >=10^6 rows then it is not saved. If counts was specified then, for now, an equivalent bodyMass vector was created and is column x (i.e. body masses are repeated).

  • 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.