| diveModel-class {diveMove} | R Documentation |
Details of model used to identify the different phases of a dive.
Objects can be created by calls of the
form new("diveModel", ...).
‘diveModel’ objects contain all relevant details of the process
to identify phases of a dive. Objects of this class are typically
generated during depth calibration, using
calibrateDepth, more specifically
.cutDive.
label.matrix:Object of class "matrix". A
2-column character matrix with row numbers matching each
observation to the full TDR object, and a vector
labelling the phases of each dive.
model:Object of class "character". A string
identifying the specific model fit to dives for the purpose of
dive phase identification. It should be one of
‘smooth.spline’ or ‘unimodal’.
dive.spline:Object of class "smooth.spline".
Details of cubic smoothing spline fit (see
smooth.spline).
spline.deriv:Object of class "list". A list
with the first derivative of the smoothing spline (see
predict.smooth.spline).
descent.crit:Object of class "numeric". The
index of the observation at which the descent was deemed to have
ended (from initial surface observation).
ascent.crit:Object of class "numeric". the
index of the observation at which the ascent was deemed to have
ended (from initial surface observation).
descent.crit.rate:Object of class "numeric".
The rate of descent corresponding to the critical quantile
used.
ascent.crit.rate:Object of class "numeric".
The rate of ascent corresponding to the critical quantile
used.
Sebastian P. Luque spluque@gmail.com
showClass("diveModel")
## Too long for checks
## Continuing the Example from '?calibrateDepth':
utils::example("calibrateDepth", package="diveMove",
ask=FALSE, echo=FALSE)
dcalib # the 'TDRcalibrate' that was created
## Compare dive models for dive phase detection
diveNo <- 255
diveX <- as.data.frame(extractDive(dcalib, diveNo=diveNo))
diveX.m <- cbind(as.numeric(row.names(diveX[-c(1, nrow(diveX)), ])),
diveX$depth[-c(1, nrow(diveX))],
diveX$time[-c(1, nrow(diveX))])
## calibrateDepth() default unimodal regression. Number of inner knots is
## either 10 or the number of samples in the dive, whichever is larger.
(phases.uni <- diveMove:::.cutDive(diveX.m, smooth.par=0.2, knot.factor=20,
dive.model="unimodal",
descent.crit.q=0.01, ascent.crit.q=0))
## Smoothing spline model, using default smoothing parameter.
(phases.spl <- diveMove:::.cutDive(diveX.m, smooth.par=0.2, knot.factor=20,
dive.model="smooth.spline",
descent.crit.q=0.01, ascent.crit.q=0))
plotDiveModel(phases.spl,
diveNo=paste(diveNo, ", smooth.par=", 0.2, sep=""))
plotDiveModel(phases.uni, diveNo=paste(diveNo))