plotTDR-methods: Methods for plotting objects of class "TDR" and...

Description Usage Arguments Details Value Methods Author(s) See Also Examples

Description

Main plotting method for objects of these classes. 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S4 method for signature 'POSIXt,numeric'
plotTDR(x, y, 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",
        dry.time=NULL, phase.factor=NULL, plot.points=FALSE,
        interact=TRUE, key=TRUE, cex.pts=0.4, ...)
## S4 method for signature 'TDR,missing'
plotTDR(x, y, concurVars, concurVarTitles, ...)
## S4 method for signature 'TDRcalibrate,missing'
plotTDR(x, y, what=c("phases", "dive.model"),
        diveNo=seq(max(getDAct(x, "dive.id"))), ...)

Arguments

x

POSIXct object with date and time, TDR, or TDRcalibrate object.

y

numeric vector with depth in m.

concurVars

matrix with additional variables in each column to plot concurrently with depth. For the (TDR,missing) and (TDRcalibrate,missing) methods, a character vector naming additional variables from the concurrentData slot to plot, if any.

xlim

POSIXct or numeric 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

character strings to label the corresponding y-axes.

concurVarTitles

character vector of titles to label each new variable given in concurVars.

xlab.format

character: 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.

dry.time

subset of time corresponding to observations considered to be dry.

phase.factor

factor dividing rows into sections.

plot.points

logical: whether to plot points.

interact

logical: whether to provide interactive tcltk controls and access to the associated ZOC functionality.

key

logical: whether to draw a key.

cex.pts

Passed to points to set the relative size of points to plot (if any).

...

For the (POSIXt,numeric) method, arguments passed to par for all methods; useful defaults las=1, bty="n", and mar (the latter depending on whether additional concurrent data will be plotted) are provided, but they can be overridden. For other methods, except (TDRcalibrate,missing), these can be any of the arguments for the (POSIXt,numeric) method. For (TDRcalibrate,missing), these are arguments for the appropriate methods.

diveNo

numeric vector or scalar with dive numbers to plot.

what

character: what aspect of the TDRcalibrate to plot, which selects the method to use for plotting.

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.

Value

If called with the interact argument set to TRUE, returns 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.

Methods

plotTDR

signature(x="TDR", y="numeric"): interactive graphical display of time-depth data, with zooming and panning capabilities.

plotTDR

signature(x="TDR", y="missing"): As method above.

plotTDR

signature(x="TDRcalibrate", y="missing"): plot selected aspects of TDRcalibrate object. Currently, two aspects have plotting methods:

  • phases (Optional arguments: concurVars, surface) Plots all dives, labelled by the activity phase they belong to. It produces a plot consisting of one or more panels; the first panel shows depth against time, and additional panels show other concurrent data in the object. Optional argument concurVars is a character vector indicating which additional components from the concurrentData slot to plot, if any. Optional argument surface is a logical: whether to plot surface readings.

  • dive.model Plots the dive model for the selected dive number (diveNo argument).

Author(s)

Sebastian P. Luque spluque@gmail.com, with many ideas from CRAN package sfsmisc.

See Also

calibrateDepth, .zoc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Continuing the Example from '?calibrateDepth':
utils::example("calibrateDepth", package="diveMove",
               ask=FALSE, echo=FALSE)
## Use interact=TRUE (default) to set an offset interactively
## Plot the 'TDR' object
plotTDR(getTime(divesTDR), getDepth(divesTDR), interact=FALSE)
plotTDR(divesTDR, interact=FALSE)

## Plot different aspects of the 'TDRcalibrate' object
plotTDR(dcalib, interact=FALSE)
plotTDR(dcalib, diveNo=19:25, interact=FALSE)
plotTDR(dcalib, what="dive.model", diveNo=25)
if (dev.interactive(orNone=TRUE)) {
    ## Add surface observations and interact
    plotTDR(dcalib, surface=TRUE)
    ## Plot one dive
    plotTDR(dcalib, diveNo=200)
}

diveMove documentation built on May 2, 2019, 4:47 p.m.