This is a real threat...even to humans! Why else would someone pay $15.75 for extra oxygen?
That's probably a whole other story...
Aquatic systems are a well known area where oxygen avaiability can potentially be much lower than that seen in the atmosphere. Part of this is due to the limited solubility of oxygen in water...depending on conditions water possesses ~30,000 less oxygen than air. There also issues relating to the diffusion rates of oxygen in water and the interplay between oxygen use and oxygen dissolution in water.
In any case...there are times when its useful to be able to predict (based on physics) how much oxygen a particular body of water could hold simply as a baseline with which to compare subsequent measurements.
Additionally, when we are measuring metabolic rates of aquatic organisms, we often measure oxygen levels in terms of % oxygen saturation, getting values like 93%. In this case, a value of 93% is not 93% oxygen. That would be rather explosive! No, instead this means that the amount of oxygen in the solution is 93% of the amount of the amount that the solution could maximally hold given the temperature, salinity, pressure. This unit is nice because it can be converted to other units, but on its own its not really useful. No one really wants to talk about an organism that consumed 7% of oxygen saturation. It just ends up being gobbledegook.
So typically we would like to express this percentage as an actual amount of oxygen, say the milligrams, µmoles, or ppm of oxygen in a given volume. Thus, we need to be able to calculate the number of umoles of oxygen in water at 93% saturation. Or maybe we want to know how many micromoles have been removed when going from 100% to 93%. All of this is to say..."Boy I wish there was a R function to calculate oxygen saturation states in lots of different units from the basic % oxgen saturation value!"
Guess what... Have I got good news for you!
Simply paste the above code into the R console and run it. To use it all you need are four (4) values.
1. the salinity of the solution,
2. the temperature of the solution (in ºC)
3. the atmospheric pressure (in mbars),
4. the percent saturation you would like to know values for (typically this is 100)
For a solution with a salinity of 28, a temperature of 14ºC, at an atmospheric pressure of 1016 mbars, in which we are interested in the amount of oxygen in the solution when it is 100% saturated with oxygen, we would use the function like this at the command line...
And the output (in two lines) looks something like this...
Clearly, this function could be applied to an entire data.frame of data to quickly calculate these values perhaps from a long term environmental dataset where salinity, temperature, pressure are recorded. Its also very useful on a very small scale to put metabolic rate measurements (values in % oxygen saturation, such as those described earlier) into an actual physical unit.
Its a small thing...but maybe someone else will also find it useful.