# Convert a numeric absolute rate to a different unit
convert_MR(-0.09, from = 'mg/min', to = 'umol/hr')
# Convert a vector of absolute rates to a different unit
convert_MR(c(-0.090, -0.081, -0.098),
from = 'mg/min', to = 'umol/hr')
# Convert to a unit which requires S, t, & P
convert_MR(-0.09, from = 'mg/min', to = 'ml/hour',
S = 0, t = 20, P = 1.01)
# Convert mass-specific rates
convert_MR(-0.09, from = 'mg/min/g', to = 'ml/hour/kg',
S = 0, t = 20, P = 1.01)
# Convert area-specific rates
convert_MR(-0.09, from = 'mg/min/mm2', to = 'ml/hour/cm2',
S = 0, t = 20, P = 1.01)
# Convert from units largely only used in older papers.
# E.g. cubic cm (e.g. Tang 1933, Head 1962)
convert_MR(0.1, from = 'cc/hr/gm', to = 'mg/hr/g',
S = 30, t = 20, P = 1.01)
convert_MR(0.6, from = 'cm3/hr', to = 'mg/hr',
S = 28, t = 12, P = 1.01)
# uL (e.g. Zeuthen 1953, Newell & Northcroft 1967)
convert_MR(400, from = 'ul/hr', to = 'mg/hr',
S = 30, t = 15, P = 1.01)
convert_MR(0.5, from = 'ul/hr/mg', to = 'mg/hr/g',
S = 0, t = 20, P = 1.01)
# mm3 (e.g. Newell & Roy 1973)
convert_MR(1.5, from = 'mm3/hr', to = 'mg/hr',
S = 30, t = 15, P = 1.01)
# Convert rates in a 'convert_rate' object. This avoids having to repeat
# an entire analysis to see the output in different units.
# Make a convert_rate object
cnv_rt.obj <- urchins.rd %>%
auto_rate() %>%
convert_rate(oxy.unit = "mg/L",
time.unit = "min",
output.unit = "mg/hr/kg",
volume = 1,
mass = 0.05)
# Now convert all results to "umol/min/g".
# The 'from' units are identified automatically from the object.
cnv_rt.obj.new <- convert_MR(cnv_rt.obj,
to = "umol/min/g")
# Compare the two:
summary(cnv_rt.obj)
summary(cnv_rt.obj.new)
Run the code above in your browser using DataLab