calc_b: Calculate the metabolic scaling coefficient, b

View source: R/calc_b.R

calc_bR Documentation

Calculate the metabolic scaling coefficient, b

Description

For most organisms, metabolic rate does not scale linearly, but rather according to a power function: MO2 = b0 * M^b. This function estimates the scaling coefficient, b, and normalization constant, b0, given MO2s from different sized individuals.

Usage

calc_b(mass, MO2, method = "nls", plot = "linear", b0_start = 1)

Arguments

mass

a vector of animal masses.

MO2

a vector of metabolic rates.

method

a string defining which method of calculating scaling coefficients to use. Default is "nls", which utilizes a nonlinear least squares regression. If this does not fit your data well, "lm" may also be used, which calculates a linear regression of log10(MO2) ~ log10(mass) with slope and intercept equivalent to b and 10^b0, respectively.

plot

a string defining what kind of plot to display. "linear" for linear axes, "log" for log10-scale axes, and "none" for no plot. Default is "linear".

b0_start

a single numeric value as the starting point for b0 value determination using the "nls" method. The default is 1 and should work for most situations, but if the "nls" method is not working and you don't want to use the "lm" method, changing the starting b0 value may help. Ignored when method = "lm".

Details

MO2 = b0 * M^b

where b0 is species-specific normalization constant, M is mass and b is the scaling coefficient.

Value

Returns a list of 1) the b value, 2) a vector of b0 values corresponding to the input MO2 values, and 3) an average b0 that can be used for summarizing the relationship with an equation.

Author(s)

Matthew A. Birk, matthewabirk@gmail.com

See Also

scale_MO2, calc_MO2

Examples

# Simple example
mass <- c(1, 10, 100, 1000, 40, 4, 400, 60, 2, 742, 266, 983) # made up values
MO2 <- mass ^ 0.65 + rnorm(n = length(mass)) # make up some data
calc_b(mass = mass, MO2 = MO2)

# How about some mass-specific MO2s?
msMO2 <- mass ^ -0.25 + rnorm(n = length(mass), sd = 0.05)
calc_b(mass = mass, MO2 = msMO2)
calc_b(mass = mass, MO2 = msMO2, plot = "log")


respirometry documentation built on July 9, 2023, 5:30 p.m.