Dive Analysis and Calibration

Utilities to represent, visualize, filter, analyse, and summarize time-depth recorder (TDR) data. Miscellaneous functions for handling location data are also provided.

Build Status CRAN_Status_Badge CRAN_Downloads

diveMove is a GNU R package with tools to represent, visualize, filter, analyse, and summarize time-depth recorder (TDR) data. It also provides miscellaneous functions for handling location data.

Read ?diveMove for a quick overview of the major functionality. A vignette is also available by doing vignette("diveMove").

Dive analysis usually involves handling of large amounts of data, as new instruments allow for frequent sampling of variables over long periods of time. The aim of this package is to make this process more efficient for summarizing and extracting information gathered by time-depth recorders (TDRs, hereafter). The principal motivation for developing diveMove was to provide more flexibility during the various stages of analysis than is available in popular commercial software. This is achieved by making the results from intermediate calculations easily accessible, allowing the user to make his/her own summaries beyond the default choices the package provides.


Get the released version from CRAN:


Or the development version from GitHub:

# install.packages("devtools")


Changes in version 1.4.4:

o Fixed bug in internal .cutDive() whereby descent and ascent critical rates were not being computed for certain dives in corner cases using very slow sampling frequencies.

o Unimodal regression on dives with less than five samples is replaced with smoothing spline, which provides the same fit much more efficiently. Otherwise, an upper bound is also introduced on the 'g' parameter for unimodal regression when this model is requested. This reduces processing time by at least 50%.

Changes in version 1.4.3:

o Fixed bug in diveStats() causing inclusion of summaries for NA values when there were any, and consequently differing number of elements in summary() output.

Changes in version 1.4.2:

o New method for dive phase detection in calibrateDepth(). By default, a new unimodal cubic spline is now available to model dives, which removes the burden of selecting the amount of smoothing in the previous smoothing spline model, although the latter is still available. The new model is fitted via unireg() from the uniReg package.

o Use na.rm=TRUE to remove missing values from defining quantiles.

Changes in version 1.4.1:

o Updated CITATION to reflect new person() arguments.

Changes in version 1.4.0:

o Packages lattice and tcltk are no longer attached, but their namespaces are required, thus resolving check warnings. Package namespace is now fully specified. No visible changes for the user.

Changes in version 1.3.9:

o Declared global variable 'x' for satisfying package checking mechanism. No visible changes for the user.

Changes in version 1.3.8:

o Moved locations of vignettes in source to follow changes in R Core.

o Removed triple colon use for objects in diveMove, which was unnecessary and discouraged.

Changes in version 1.3.7:

o Default value for argument concurrentData in createTDR() is a data.frame with the same number of rows as time stamps provided, to keep consistency with readTDR() and getCCData() functionality.

o The package now requires caTools, KernSmooth, quantreg, and geosphere to be available. However, they are not attached; only parts of their namespaces are imported, so diveMove now makes more efficient use of system's resources.

o distSpeed() now uses algorithms from package 'geosphere' for distance calculations.

o Removed dependence on the 'RColorBrewer' package, and use hsv() for generating colors.

Changes in version 1.3.6:

o Fixed show method for 'TDRcalibrate', which should display that the units are determined by the instrument.

o More accurate calculation of data range in plotDiveModel().

Changes in version 1.3.5:

o New argument (logical) 'wet.cond' for .detPhase() and calibrateDepth() to designate a condition for identifying wet/dry conditions. Previously, this was done assuming that depth was recorded only when wet (i.e. when a salt-water switch is available and used accordingly). This assumption holds if new argument 'wet.cond' is not supplied.

o Improved documentation.

Changes in version 1.3.4:

o New argument 'diveNo' for .derivStats() to extract derivative statistics only for requested dives. Duplicates are ignored.

o Better resolution when zooming in plotTDR().

o Elements 'trip.no' and 'trip.type' in value returned by stampDive() are now named 'phase.no' and 'activity', respectively, for consistency. Similarly, element 'phaseno' in timeBudget() is now named 'phase.no'.

o Improved documentation.

Changes in version 1.3.3:

o Duplicate time stamps are no longer allowed in 'TDR' objects.

Changes in version 1.3.2:

o Datasets in data/ are now compressed with bzip2.

o Improved documentation.

Changes in version 1.3.1:

o Improved formatting of code in vignette. Figure resolution reduced to satisfy package check requirements.

o At least R 2.13.0 is required.

Changes in version 1.3.0:

o Dives occurring in "trivial wet" periods are now identified.

o Improved validity checking for 'TDRcalibrate' objects.

o 'TDRcalibrate' accessor methods now explicitly check and report that requested dives exist.

o plotTDR() now conditionally generates initial plot, after preparing Tcl/Tk widgets, to accomodate for changes in R 2.14.2. Legend is plotted only if there is at least one level in the phase factor.

Changes in version 1.2.9:

o plotTDR() now subsets data based on the zoom scale, so plotting is much faster.

Changes in version 1.2.8:

o Ensure that 'locations' argument in readLocs() is a string, if not a connection.

Changes in version 1.2.7:

o Prepare inst/doc/Makefile for R 2.14.0; Rd2dvi will be deprecated, so use Rd2pdf.

o Removed .onLoad() since it was only needed for require() calls that are no longer needed.

Changes in version 1.2.6:

o New generic plotZOC() with methods for plotting ZOC procedure and visually assess performance.

Changes in version 1.2.5:

o New methods for models consisting of three Poisson processes for detection of dive bouts. For now, only log-frequency NLS procedure is supported. Corresponding maximum likelihood approach or better might be available later.

o readTDR() and readLocs() now accept reading from text-mode connections, as allowed in read.csv().

o New ellipsis argument for boutfreqs() and boutinit() for more flexibility in plots.

o NAMESPACE now uses an empty exportClassPattern() to over-ride exportPattern(), and keep using the explicit exportClasses().

Changes in version 1.2.4:

o Updated reference for "filter" method in zero offset correction.

Changes in version 1.2.3:

o If smooth.par is NULL, then then the smoothing parameter is determined by Generalized Cross-validation (GCV) when fitting spline dive model for determining dive phases. This approach is only useful when studying individual dives, hence it is not the default in calibrateDepth() for TDR objects, which may contain multiple dives.

Changes in version 1.2.2:

o New argument plot.points in plotTDR() methods allows plotting points when plotting basic TDR objects.

Changes in version 1.2.1:

o Implemented new plotTDR() generic, providing more consistent interface for all classes.

o diveStats() provides more dive summary statistics, including derivative summaries.

o When interp.wet=TRUE and there are no missing depth observations, calibrateDepth() no longer performs interpolation.

Changes in version 1.2:

o Improved procedure for defining dive phases. The method uses smoothing splines and their derivatives to find the end of descent and the beginning of ascent, which form the basis for the identification of the rest of the phases. This prompted the creation of a new S4 class to hold the details of the dive modelling process. New plotting and accessor methods are also provided to examine the process. Additional methods are being developed to take full advantage of the information available in objects of this class.

o Removed /data objects 'divesTDRcalibrate' and 'divesSummary' because it is better to generate and inspect them in examples in help files.

o New slot 'call' for 'TDRcalibrate' class recording the matching call to the corresponding generator calibrateDepth().

Changes in version 1.1:

o New method for zero-offset correction based on sequential running quantile smoothing/filtering. Thanks to Roland Fried for suggesting this approach. Although still under development, it already produces reliable results. This has made it necessary to change how calibrateDepth() is used, so that the old 'offset' argument is now passed as part of the ellipsis ('...') argument, and a new argument 'zoc.method' is required to choose among the three available methods. Function zoc() has been relegated to an internal function (.zoc()) to avoid duplication of arguments.

o New argument 'interp.wet' (logical) in calibrateDepth() that controls whether a spline interpolation method should be used to impute missing data during periods coded as wet. This is useful to rectify problems with some instruments or on-board software that produce incomplete dive traces, where observations near or at the surface are often missing.

o Removed unnecessary default in .detDive().

o Removed unused arguments 'interval' and ellipsis from .labDive() and .detDive(), respectively.

o Replaced ellipsis argument with 'interval' in .detPhase().

o The package now depends on caTools (for new ZOC method) and RColorBrewer (for better coloring of points in plot methods).

Changes in version 1.0:

o Fixed bug in "[" method for TDR objects with empty 'concurrentData' 'data.frame'.

o Minor documentation fixes.

Changes in version 0.9.9:

o readLocs() now accepts a string for a path or an existing 'data.frame' to read data from.

Changes in version 0.9.8:

o New function .POSIXct() is used for assignments to S4 time slots, in preparation for 2.12.0.

Changes in version 0.9.7:

o New argument '...' to readTDR for more flexibility in formats of input files. This is passed to read.csv().

o Comma-delimited files (*.csv) under data/ are now delimited by semi-colon so they load as proper 'data.frame' objects with data().

Changes in version 0.9.6:

o Fixed .cutDive() to behave as intended: wiggles above wiggle.tol should not be allowed to terminate descent phase.

o Better documentation explaining the basics of dive phase detection.

Changes in version 0.9.5:

o Documentation fixes in preparation for new release. New parser has more strict rules for syntax.

Changes in version 0.9.4:

o More helpful help pages, particularly in readTDR(), to indicate that problems in input text files are better dealt with outside GNU R.

o Vignette now includes introduction to the bout detection functions.

Changes in version 0.9.3:

o Fixed bug that avoided vignette to be built.

Changes in version 0.9.2:

o New vignette now builds up on R News article.

o Fixed bug in diveStats() so that a warning regarding duplicate row.names is no longer given.

Changes in version 0.9.1:

o Use the 'grid' manager rather than 'pack', and rearrange widgets for a better fit in plotTD().

Changes in version 0.9.0:

o Minor package-building improvements.

Changes in version 0.8.9:

o Fixed bug in rmsDistFilter() causing the filter to fail with very small data sets with message warning that window size is larger than available data, because locations at ends were not being counted.

Changes in version 0.8.8:

o The root-mean-square filter in rmsDistFilter() now works as described in Freitas et al. (2008), rather than as in the original McConnell et al. (1992). The latter may not have been the actual implementation, although other studies may have followed it (e.g. Austin et al. 2003).

Changes in version 0.8.7:

o Fixed citations in *.Rd files and CITATION.

Changes in version 0.8.6:

o Fixed bug in grpSpeedFilter() whereby the test to fail if any speed > threshold, rather than if ALL speeds > threshold.

Changes in version 0.8.5:

o Improved validity check for input in distFilter().

Changes in version 0.8.4:

o Fixed bug in rmsDistfilter() to intercept an error due to the number of rows being exactly equal to the test window size. The dimensions of internal objects are now handled properly.

Changes in version 0.8.3:

o Better explanation of location filtering procedures in man pages.

Changes in version 0.8.0:

o New methods for identification and analysis of bouts of behaviour (mostly diving, but apply to others too).

Changes in version 0.7-8:

o Better arrangement of widgets in plotTD() and its methods.

Changes in version 0.7-7:

o S4 documentation bug fix.

Changes in version 0.7-6:

o Fixes bug in plotTD() to work with stricter object class management in R devel.

Changes in version 0.7-5:

* Full examples for movement functions.

Changes in version 0.7-4:

o distSpeed() no longer uses 'id' argument.

o Complete examples for location filtering functions.

o createTDR() now provides useful default for 'concurrentData', and test for missing 'dtime'. Completed example accordingly.

o Improved show() method for 'TDRcalibrate' objects.

o plotTD(), and hence the plotTDR() methods now accept an ellipsis argument to pass to par() for more flexibility drawing the plot. They also now accept a new argument 'cex.pts' to set the relative size of points.

Changes in version 0.7-3:

o detPhase() and detDive() are now private functions (renamed with a preceding dot), and should only be used through calibrateDepth().

o Rearranged documentation, reflecting the higher importance of calibrateDepth() and calibrateSpeed() functions.

o distSpeed() no longer uses 'speed' and 'subset' arguments, and always returns a matrix. All location filtering functions are now adapted to this change.

Changes in version 0.7-2:

o More examples for important functions.

Changes in version 0.7-1:

o 'TDRcalibrate' method for plot() now plots correctly if no dives were identified. New argument 'interact' to allow for static plots, without 'tcltk' interaction.

o plot method replaced by 'plotTDR', to avoid unusual introduction of arguments in methods and simplify code. This method is now based on the new function plotTD(), which replaces plotDive(). This system now makes the relationships between functions much more clear.

o Function getAct() renamed to rleActivity() to make it clearer that it calculates statistics from running series of readings with the same activity.

Changes in version 0.7-0:

o Arguments 'seaerr', 'landerr', and 'divethres' were renamed to 'wet.thr', 'dry.thr', and 'dive.thr'. Likewise, slots 'land.threshold', 'sea.threshold', and 'dive.threshold' in class TDRcalibrate were renamed to 'dry.thr', 'wet.thr', and 'dive.thr', respectively, for consistency/appropriateness.

o The argument 'contours' to rqPlot() should now be a list with 2 components.

Changes in version 0.6-9:

o New arguments for calibrateDepth(), offering improved control over detection of descent, bottom, and ascent phases. We now use rates of vertical movement for detection, with a further argument for defining what determines a bottom wiggle.

o New arguments for plotDive() to decide whether to plot legend and to set limits for depth plot.

o Documentation for formal classes and methods was split to make them easier to read.

o attendance() has been renamed to timeBudget().

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.