Learn R Programming

respirometry (version 2.0.0)

mean_pH: Mean pH by [H+]

Description

Calculates mean pH from a vector of pH values by averaging [H+] rather than numerical pH values.

Usage

mean_pH(pH, na.rm = FALSE, ...)

Arguments

pH

a numeric vector of pH values.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

...

further arguments passed to or from other methods.

Author

Matthew A. Birk, matthewabirk@gmail.com

Details

Since pH is on a logarithmic scale, averaging pH values directly does not provide the true arithmetic mean of what is likely truly important to the organism, [H+] (however, see Boutilier and Shelton 1980). Thus, the pH values are converted to [H+] then averaged and converted back to a mean pH value.

References

Boutilier RG, Shelton G. 1980. The statistical treatment of hydrogen ion concentration and pH. J Exp Biol. 84:335–339.

Examples

Run this code
mean_pH(c(7, 8)) # 7.26 rather than 7.5!

Run the code above in your browser using DataLab