Learn R Programming

diveMove (version 1.1)

plotTD: Interactive plotting and zero-offset correction windows for "TDR" data

Description

Plot and optionally set zero-offset correction windows in TDR records, with the aid of a graphical user interface (GUI), allowing for dynamic selection of offset and multiple time windows to perform the adjustment.

Usage

plotTD(time, depth, concurVars=NULL, xlim=NULL, depth.lim=NULL,
       xlab="time (dd-mmm hh:mm)", ylab.depth="depth (m)",
       concurVarTitles=deparse(substitute(concurVars)),
       xlab.format="%d-%b %H:%M", sunrise.time="06:00:00",
       sunset.time="18:00:00", night.col="gray60", phase.factor=NULL,
       interact=TRUE, key=TRUE, cex.pts=0.4, ...)

Arguments

time
POSIXct object with date and time.
depth
Numeric vector with depth in m.
concurVars
Matrix with additional variables in each column to plot concurrently with depth.
xlim
Vector of length 2, with lower and upper limits of time to be plotted.
depth.lim
Numeric vector of length 2, with the lower and upper limits of depth to be plotted.
xlab, ylab.depth
Strings to label the corresponding y-axes.
concurVarTitles
Character vector of titles to label each new variable given in concurVars.
xlab.format
Format string for formatting the x axis; see strptime.
sunrise.time, sunset.time
Character string with time of sunrise and sunset, respectively, in 24 hr format. This is used for shading night time.
night.col
Color for shading night time.
phase.factor
Factor dividing rows into sections.
interact
Logical; whether to provide interactive tcltk controls and access to the associated ZOC functionality.
key
Logical indicating whether to draw a key.
cex.pts
Passed to points to set the relative size of points to plot (if any).
...
Arguments passed to par; useful defaults las=1, bty="n", and mar (the latter depending on whether additional concurrent data will be plotted) are provided, but

Value

  • A list (invisibly) with as many components as sections of the record that were zero-offset corrected, each consisting of two further lists with the same components as those returned by locator.

Details

This function is used primarily to correct drifts in the pressure transducer of TDR records and noise in depth measurements via method=visual in calibrateDepth.

See Also

calibrateDepth, and plotTDR.

Examples

Run this code
data(divesTDR)

## Use interact=TRUE (default) to set the offset interactively
plotTD(getTime(divesTDR), getDepth(divesTDR), interact=FALSE)

Run the code above in your browser using DataLab