addSMR: Add SMR to an existing plot of oxygen uptake values as a...

Description Usage Arguments Details Author(s) See Also Examples

View source: R/addSMR.R

Description

Displays a horizontal line representing the Standard Metabolic Rate on top of a plot of MO2 vs time. A label can be shown optionally.

Usage

1
addSMR(SMR, SMRcol = "orange", SMRcex = 0.85, showLabel = T, ...)

Arguments

SMR

The SMR, a constant obtained previously, usually obtained with calcSMR.

SMRcol

A colour for the horizontal line.

SMRcex

The size of the text label that can be shown next to the line, at the left of the plot.

showLabel

Boolean, TRUE displays the "SMR" label as well as the value of SMR.

...

Other graphics parameters that work with lines, such as lwd for line width, lty for line type.

Details

A horizontal line representing SMR is added to the existing plot.

Author(s)

Denis Chabot, Institut Maurice-Lamontagne, Department of Fisheries and Oceans.

See Also

calcSMR, plotMO2, par

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data("GrHalO2crit")
# remove a 10-h acclimation period; also remove the last 11 h, when DO was
#    decreasing to calculate O2crit. There were no low R^2s that required removal
smr.indices = GrHalO2crit$DateTime >= GrHalO2crit$DateTime[1] + 10*60*60 &
              GrHalO2crit$DateTime <= GrHalO2crit$DateTime[nrow(GrHalO2crit)] - 11*60*60
smr = calcSMR(GrHalO2crit$MO2[smr.indices])  # contains several estimations of
                                             # SMR, need to chose one
SMR = as.numeric(ifelse(smr$CVmlnd > 5.4, smr$quant[4], smr$mlnd))
SMR     # as recommended in Chabot et al. 2016
GrHalO2crit$pch = ifelse(smr.indices, 1, 0)
GrHalO2crit$col = ifelse(smr.indices, "blue", grey(0.5))
plotMO2(GrHalO2crit$DateTime, GrHalO2crit$MO2, mo2="dotital", o2="umol",
        t="min", m="kg", showO2 = FALSE,
        Xlab = "Time (month-day)", pch=GrHalO2crit$pch, col=GrHalO2crit$col)
legend("topright", c("Used to calculate SMR", "Not used to calculate SMR"),
       pch=c(1,0), col=c("blue", grey(0.5)), bty="n")
addSMR(SMR)

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