Learn R Programming

oce (version 1.7-10)

plotAD2CP: Plot an AD2CP Object

Description

Used by plot,adp-method or called directly, this function plots some aspects of AD2CP data. The which parameter has an entirely different meaning to that of plot,adp-method, because AD2CP objects are laid out differently from other adp objects. As an aide, which can be supply prompts that will work with the particular object at hand, e.g. using plotAD2CP(x,which="?") will print a message indicating the names of items in the data slot that can be plotted. If, say, one of these is "average", then using which="average/?" will display a message indicating the items within the "average" records that can be plotted. Some of those items (e.g. "magnetometer") can be explored further, using which="average/magnetometer/?"; see Example 3.

Usage

plotAD2CP(x, which = NULL, cex, col, pch, lwd, type, ...)

Arguments

x

an AD2CP object, as created with read.adp.ad2cp() or by read.oce() on a file of the AD2CP type.

which

a character value indicating what to plot. Use NULL to see a listing of the possibilities for this particular object. See “Details” and “Examples”, and note that some understanding of the object layout is required to devise which properly. If which is inappropriate for this particular x, then hints are printed to help guide the user to something that will work.

cex

character expansion factor

col

indication of colour, passed to imagep() or to oce.plot.ts(), depending on whether the plot is an image or a time-series graph. This defaults to oceColorsVelocity for velocity images, oceColorsViridis for amplitude and quality images, and to black for time-series plots.

pch

character code

lwd

line width, used only for time-series graphs.

type

plot type, used only for time-series graphs.

...

optional other arguments, passed to the lower-level plotting commands.

Author

Dan Kelley

Examples

Run this code
library(oce)
# This example will only work for the author, because it uses a
# private file.  The file contains 'burst' and 'average' data.
f <- "/Users/kelley/Dropbox/oce_secret_data/ad2cp/secret1_trimmed.ad2cp"
if (file.exists(f)) {
    library(oce)
    d <- read.oce(f)
    # Example 1: time-distance variation of "average" velocity (beams 1 through 4)
    plot(d, which="average/v", col=oceColorsVelocity)
    # Example 2: time variation of "average" amplitude (beam 1)
    plot(d, which="average/a/1")
    # Example 3: time variation of "burst" magnetometer (x component)
    plot(d, which="burst/magnetometer/x")
    # Example 4: time variation of "burst" AHRS/gyro
    plot(d, which="burst/AHRS/gyro")
}

Run the code above in your browser using DataLab