makeO2lab: Make a formatted label for oxygen uptake (MO2), SDA or oxygen...

Description Usage Arguments Details Value Author(s) Examples

Description

Plot labels involving oxygen usually require subscript, superscript, italic or dot formatting. This function facilitates the creation of such labels.

Usage

1
2
3
4
5
6
7
8
9
makeO2lab(
  mo2 = c("dotital", "dot", "ital", "plain", "hidden"),
  o2 = c("mg", "ug", "mmol", "umol", "ml", "mL"),
  t = c("hr", "min"),
  m = c("kg", "g", "mg"),
  v = c("l", "L"),
  showO2 = F,
  Type = c("MO2msp", "MO2ind", "SDAmsp", "SDAind", "conc")
)

Arguments

mo2

If the label is for oxygen uptake (see Type), selects the formatting of the expression MO2, such as dotital (adds a dot on italics M to express a rate), dot, ital or plain. The expression MO2 can also by hidden. Not used for SDA or concentration labels.

o2

Oxygen units, either mg, ug (gives microg), mmol, umol (gives micromol), ml or mL.

t

Time unit, either hr or min.

m

Mass unit for the animal, either kg, g or mg. Used for mass-specific MO2 or SDA, not used in "per individual" measurements.

v

Volume unit when dealing with oxygen concentration.

showO2

Logical, to hide or show O2 after the oxygen unit.

Type

Select the type of label, either for mass-specific MO2 (MO2msp), individual MO2 (MO2ind), mass-specific SDA magnitude (SDAmsp), individual SDA magnitude (SDAind) or oxygen concentration (conc).

Details

The combination of R language and Tex commands required to obtain complex labels can be difficult to master (and remember). This single function allows the user to format a wide variety of labels dealing with MO2, SDA, oxygen concentration to produce publication-quality figures.

Value

Returns the formatted label.

Author(s)

Denis Chabot, Institut Maurice-Lamontagne, Fisheries and Oceans Canada.

Examples

1
2
3
# for a plot of MO2 as a function of time
mo2lab = makeO2lab(mo2="dotital", o2= "mg", t="hr", m="kg", v="l", showO2 = FALSE, Type="MO2msp")
plot(1:10, xlab="Time", ylab=mo2lab, mgp=c(2,0.5,0))

denis-chabot/fishMO2 documentation built on July 16, 2020, 1:53 a.m.