plotDiveModel: Methods for plotting models of dive phases

plotDiveModel,diveModel,missing-methodR Documentation

Methods for plotting models of dive phases

Description

All methods produce a double panel plot. The top panel shows the depth against time, the cubic spline smoother, the identified descent and ascent phases (which form the basis for identifying the rest of the dive phases), while the bottom panel shows the first derivative of the smooth trace.

Usage

## S4 method for signature 'diveModel,missing'
plotDiveModel(x, diveNo)

## S4 method for signature 'TDRcalibrate,missing'
plotDiveModel(x, diveNo)

## S4 method for signature 'numeric,numeric'
plotDiveModel(
  x,
  y,
  times.s,
  depths.s,
  d.crit,
  a.crit,
  diveNo = 1,
  times.deriv,
  depths.deriv,
  d.crit.rate,
  a.crit.rate
)

Arguments

x

A diveModel (diveModel,missing method), numeric vector of time step observations (numeric,numeric method), or TDRcalibrate object (TDRcalibrate,numeric method).

diveNo

integer representing the dive number selected for plotting.

y

numeric vector with depth observations at each time step.

times.s

numeric vector with time steps used to generate the smoothing spline (i.e. the knots, see diveModel).

depths.s

numeric vector with smoothed depth (see diveModel).

d.crit

integer denoting the index where descent ends in the observed time series (see diveModel).

a.crit

integer denoting the index where ascent begins in the observed time series (see diveModel).

times.deriv

numeric vector representing the time steps where the derivative of the smoothing spline was evaluated (see diveModel).

depths.deriv

numeric vector representing the derivative of the smoothing spline evaluated at times.deriv (see diveModel).

d.crit.rate

numeric scalar: vertical rate of descent corresponding to the quantile used (see diveModel).

a.crit.rate

numeric scalar: vertical rate of ascent corresponding to the quantile used (see diveModel).

Methods (by class)

  • x = diveModel,y = missing: Given a diveModel object and (possibly) the dive number that it corresponds to, the plot shows the model data.

  • x = TDRcalibrate,y = missing: Given a TDRcalibrate object and a dive number to extract from it, this method plots the observed data and the model. The intended use of this method is through plotTDR when what="dive.model".

  • x = numeric,y = numeric: Base method, requiring all aspects of the model to be provided.

Author(s)

Sebastian P. Luque spluque@gmail.com

See Also

diveModel

Examples

## Too long for checks

## Continuing the Example from '?calibrateDepth':
utils::example("calibrateDepth", package="diveMove",
               ask=FALSE, echo=FALSE, run.donttest=TRUE)

## 'diveModel' method
dm <- getDiveModel(dcalib, 100)
plotDiveModel(dm, diveNo=100)

## 'TDRcalibrate' method
plotDiveModel(dcalib, diveNo=100)



diveMove documentation built on Nov. 10, 2022, 5:11 p.m.