Description Usage Arguments Value Note Author(s) References See Also Examples
Converts between different different units of DO concentration. Takes into account ambient temperature, pressure and salinity.
1 2 3 | DO.unit.convert(x, DO.units.in, DO.units.out, bar.units.in,
bar.press, temp.C, bar.units.out = "mmHg",
salinity = 0, salinity.units = "pp.thou")
|
x |
Value or object of class numeric to be converted. |
DO.units.in |
Units of dissolved oxygen concentration measured, i.e. to be converted from. Must be |
DO.units.out |
Units of dissolved oxygen concentration desired, i.e. to be converted to. Must be |
bar.units.in |
Units of barometric pressure of user specified barometric pressure measurement. Must take value of |
bar.press |
Ambient barometric pressure measurement |
temp.C |
Water temperature measured in degrees C |
bar.units.out |
Used in internal calculation, only visible if output DO.units.out = |
salinity |
Salinity, either reported in parts per thousand ( |
salinity.units |
Salinity units, must be |
Numeric object representing dissolved oxygen concentration in the units specified by DO.units.out.
Use this function on entire data columns to convert them to desired units before analysing with functions like MR.loops and get.pcrit.
Tyler L. Moulton
Mechtly, E. A., 1973: The International System of Units, Physical Constants and Conversion Factors. NASA SP-7012, Second Revision, National Aeronautics and Space Administration, Washington, D.C. https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19730018242.pdf.
U.S. Geological Survey (2011). Change to solubility equations for oxygen in water: Office of Water Quality Technical Memorandum 2011.03, accessed July 15, 2011, at http://water.usgs.gov/admin/memo/QW/qw11.03.pdf.
plot,
plotRaw,
cbind,
Eq.Ox.conc,
DO.saturation,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ## on a single value ##
DO.pct<- DO.unit.convert(x= 125.6863, DO.units.in = "PP",
DO.units.out = "pct",
bar.units.in = "mmHg", bar.press = 750, temp.C =15)
## Apply to a column in a 'data.frame' class object ##
## load data ##
data(fishMR)
## create time variable in POSIXct format ##
fishMR$std.time <- as.POSIXct(fishMR$Date.time,
format = "%d/%m/%Y %I:%M:%S %p")
head(fishMR)
#note that DO data are in mg/L (DO.mgL) and
#that there is an instantaneous temperature column
#(temp.C) and a pressure column (Bar.Pressure.hpa)
DO.pct.col.a <- DO.unit.convert(fishMR$DO.mgL, DO.units.in = "mg/L",
DO.units.out = "pct",
bar.units.in = "kpa", bar.press = 101.3,
temp.C = fishMR$temp.C,
bar.units.out = "kpa")
DO.pct.col.b<- DO.unit.convert(fishMR$DO.mgL, DO.units.in = "mg/L",
DO.units.out = "pct",
bar.units.in = "kpa", bar.press = 101.3,
temp.C = fishMR$temp.C)
head(DO.pct.col.a)
head(DO.pct.col.b)
# Now with df #
fishMR2 <- as.data.frame(cbind(fishMR, DO.pct.col.a))
par(mfrow = c(1,2))
plotRaw(data = fishMR, DO.var.name = "DO.mgL",
start.time = "2015-07-03 06:15:00",
end.time = "2015-07-03 08:05:00",
main = "DO (mg/L) vs time",
xlab = "time",
ylab = "DO (mg/L)")
plotRaw(data = fishMR2, DO.var.name = "DO.pct.col.a",
start.time = "2015-07-03 06:15:00",
end.time = "2015-07-03 08:05:00",
main = "DO (percent saturation) vs time",
xlab = "time",
ylab = "DO (percent saturation)")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.