Learn R Programming

fb4package (version 2.0.0)

calculate_np_ratios: Calculate N:P ratios for all processes

Description

Calculates molar and mass N:P ratios for consumption, growth, excretion and egestion. Useful for understanding nutritional ecology and stoichiometric balance.

Usage

calculate_np_ratios(nitrogen_fluxes, phosphorus_fluxes, ratio_type = "mass")

Value

A named list with three elements:

ratios

Named numeric vector of length 4 giving the N:P ratio for each process (consumed, growth, excretion, egestion). Values may be Inf when phosphorus is zero and NaN when both nutrients are zero.

ratio_type

Character. The ratio type as supplied ("mass" or "molar").

redfield_ratio

Numeric. Reference Redfield ratio: 7.2 for mass ratios and 16 for molar ratios.

Arguments

nitrogen_fluxes

List result from calculate_nutrient_balance (nitrogen component)

phosphorus_fluxes

List result from calculate_nutrient_balance (phosphorus component)

ratio_type

Type of ratio ("mass" or "molar"), default "mass"

Examples

Run this code
nitrogen   <- list(consumed = 10, growth = 3, excretion = 5, egestion = 2)
phosphorus <- list(consumed = 1.5, growth = 0.5, excretion = 0.6, egestion = 0.4)
np_ratios  <- calculate_np_ratios(nitrogen, phosphorus)
np_ratios$ratios

Run the code above in your browser using DataLab