Learn R Programming

diveMove (version 0.6-6)

TDRcalibrate-class: Class "TDRcalibrate" for dive analysis

Description

This class holds information produced at various stages of dive analysis. Methods are provided for extracting data from each slot.

Usage

## S3 method for class 'TDRcalibrate,logical':
attendance(obj, ignoreZ)
## S3 method for class 'TDRcalibrate,numeric,missing':
extractDive(obj, diveNo)
## S3 method for class 'TDRcalibrate,missing':
getDAct(x)
## S3 method for class 'TDRcalibrate,character':
getDAct(x, y)
## S3 method for class 'TDRcalibrate,missing':
getDPhaseLab(x)
## S3 method for class 'TDRcalibrate,numeric':
getDPhaseLab(x, diveNo)
## S3 method for class 'TDRcalibrate,missing':
getGAct(x)
## S3 method for class 'TDRcalibrate,character':
getGAct(x, y)
## S3 method for class 'TDRcalibrate,missing':
plot(x, diveNo=seq(unique(getDAct(x, "dive.id"))),
     labels="phase.id", surface=FALSE, ...)

Arguments

x, obj
"TDRcalibrate" object.
ignoreZ
logical indicating whether to ignore trivial aquatic periods.
diveNo
numeric vector with dive numbers to plot.
labels
one of phase.id or dive.phase, specifying whether to label observations based on the gross phase ID of the "TDR" object, or based on each dive phase, respectively.
surface
logical indicating whether to plot surface readings.
...
further arguments to plotDive.
y
string; dive.id, dive.activity, or postdive.id in the case of getDAct, to extract the numeric dive ID, the factor identifying dive phases in each dive, or the numeric postdive ID,

Objects from the Class

Objects can be created by calls of the form new("TDRcalibrate", ...). The objects of this class contain information necessary to divide the record into sections (e.g. land/water), dive/surface, and different sections within dives. They also contain the parameters used to calibrate speed and criteria to divide the record into phases.

Details

This is perhaps the most important class in diveMove, as it holds all the information necessary for calculating requested summaries for a TDR.

The tdr slot contains the time, zero-offset corrected depth, and possibly calibrated or uncalibrated speed. See readTDR and the accessor function getTDR for this slot. Convenient access to each vector in this slot is available through getTime, getDepth, and getSpeed.

The slot gross.activity holds, as a list, a vector (named phase.id) numbering each major activity phase found in the record, a factor (named trip.act) labelling each row as being on-land, at-sea, or leisure at-sea activity. These two elements are as long as there are rows in tdr. This slot also contains two more vectors: one with the beginning time of each phase, and another with the ending time; both represented as POSIXct objects. See detPhase.

The slot dive.activity contains a data.frame, again with as many rows as those in tdr, consisting of three vectors named: dive.id, which is an integer vector, sequentially numbering each dive (rows that are not part of a dive are labelled 0), dive.activity is a factor which completes that in trip.act above, further identifying rows in the record belonging to a dive. The third vector in dive.activity is an integer vector sequentially numbering each postdive interval (all rows that belong to a dive are labelled 0). See detDive, and getDAct to access all or any one of these vectors.

dive.phases is a slot corresponding to a factor that labels each row in the record as belonging to a particular phase of a dive. See labDivePhase, and getDPhaseLab to access this slot.

land.threshold, sea.threshold, dive.threshold, and speed.calib.coefs are each a single number representing parameters used for detecting phases, and calibrating the TDR. Except for the latter, these are mostly for internal use, and hence do not have an accessor function. See getSpeedCoef for accessing speed.calib.coefs.

The plot method for this class creates an interactive plot of the "TDR" object, labelling the identified observations with a chosen factor from the corresponding "TDRcalibrate" object. The argument surface allows for the inclusion/exclusion of identified surface readings.

See Also

TDR-class for links to other classes in the package