Learn R Programming

diveMove (version 1.2.2)

TDRcalibrate-accessors: Methods to Show and Extract Basic Information from "TDRcalibrate" Objects

Description

Show and extract information from TDRcalibrate objects.

Usage

## 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':
getDiveModel(x)
## S3 method for class 'TDRcalibrate,numeric':
getDiveModel(x, diveNo)
## S3 method for class 'diveModel':
getDiveDeriv(x, phase=c("all", "descent", "bottom", "ascent"))
## S3 method for class 'TDRcalibrate':
getDiveDeriv(x, diveNo, phase=c("all", "descent", "bottom", "ascent"))
## S3 method for class 'TDRcalibrate,missing':
getGAct(x)
## S3 method for class 'TDRcalibrate,character':
getGAct(x, y)

Arguments

x
TDRcalibrate object.
diveNo
numeric vector with dive numbers to extract information from.
y
string; dive.id, dive.activity, or postdive.id in the case of getDAct, to extract the numeric dive ID, the factor identifying activity phases (with underwater and diving levels po
phase
character vector indicating phase of the dive for which to extract the derivative.

Value

  • The extractor methods return an object of the same class as elements of the slot they extracted.

See Also

diveModel, plotDiveModel, plotTDR.

Examples

Run this code
## Continuing the Example from '?calibrateDepth':
utils::example("calibrateDepth", package="diveMove",
               ask=FALSE, echo=FALSE)
dcalib		# the 'TDRcalibrate' that was created

## Beginning times of each successive phase in record
getGAct(dcalib, "begin")

## Factor of dive IDs
dids <- getDAct(dcalib, "dive.id")
table(dids[dids > 0])		# samples per dive

## Factor of dive phases for given dive
getDPhaseLab(dcalib, 19)
## Full dive model
(dm <- getDiveModel(dcalib, 19))
str(dm)

## Derivatives
getDiveDeriv(dcalib, diveNo=19)
(derivs.desc <- getDiveDeriv(dcalib, diveNo=19, phase="descent"))
(derivs.bott <- getDiveDeriv(dcalib, diveNo=19, phase="bottom"))
(derivs.asc <- getDiveDeriv(dcalib, diveNo=19, phase="ascent"))
if (require(lattice)) {
    fl <- c("descent", "bottom", "ascent")
    bwplot(~ derivs.desc$y + derivs.bott$y + derivs.asc$y,
           outer=TRUE, allow.multiple=TRUE, layout=c(1, 3),
           xlab=expression(paste("Vertical rate (", m %.% s^-1, ")")),
           strip=strip.custom(factor.levels=fl))
}

Run the code above in your browser using DataLab