diveModel-class {diveMove} | R Documentation |
Class "diveModel" for representing a model for identifying dive phases
Description
Details of model used to identify the different phases of a dive.
Slots
label.matrix
Object of class
"matrix"
. A 2-column character matrix with row numbers matching each observation to the fullTDR
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 (seesmooth.spline
).spline.deriv
Object of class
"list"
. A list with the first derivative of the smoothing spline (seepredict.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.
Objects from the Class
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
.
Author(s)
Sebastian P. Luque spluque@gmail.com
See Also
Examples
showClass("diveModel")
## Too long for checks
## Continuing the Example from '?calibrateDepth':
utils::example("calibrateDepth", package="diveMove",
ask=FALSE, echo=FALSE, run.donttest=TRUE)
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))