TDRcalibrate-accessors {diveMove} | R Documentation |
Methods to Show and Extract Basic Information from "TDRcalibrate" Objects
Description
Show and extract information from
TDRcalibrate
objects.
Usage
## S4 method for signature 'TDRcalibrate,missing'
getDAct(x)
## S4 method for signature 'TDRcalibrate,character'
getDAct(x, y)
## S4 method for signature 'TDRcalibrate,missing'
getDPhaseLab(x)
## S4 method for signature 'TDRcalibrate,numeric'
getDPhaseLab(x, diveNo)
## S4 method for signature 'TDRcalibrate,missing'
getDiveModel(x)
## S4 method for signature 'TDRcalibrate,numeric'
getDiveModel(x, diveNo)
## S4 method for signature 'diveModel'
getDiveDeriv(x, phase=c("all", "descent", "bottom", "ascent"))
## S4 method for signature 'TDRcalibrate'
getDiveDeriv(x, diveNo, phase=c("all", "descent", "bottom", "ascent"))
## S4 method for signature 'TDRcalibrate,missing'
getGAct(x)
## S4 method for signature 'TDRcalibrate,character'
getGAct(x, y)
## S4 method for signature 'TDRcalibrate'
getSpeedCoef(x)
## S4 method for signature 'TDRcalibrate'
getTDR(x)
Arguments
x |
|
diveNo |
numeric vector with dive numbers to extract information from. |
y |
string; “dive.id”, “dive.activity”, or
“postdive.id” in the case of |
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.
Show Methods
- show
signature(object="TDRcalibrate")
: prints an informative summary of the data.- show
signature(object="diveModel")
: prints an informative summary of a dive model.
Extractor Methods
- getDAct
signature(x="TDRcalibrate", y="missing")
: this accesses thedive.activity
slot ofTDRcalibrate
objects. Thus, it extracts a data frame with vectors identifying all readings to a particular dive and postdive number, and a factor identifying all readings to a particular activity.- getDAct
signature(x="TDRcalibrate", y="character")
: as the method for missingy
, but selects a particular vector to extract. SeeTDRcalibrate
for possible strings.- getDPhaseLab
signature(x="TDRcalibrate", diveNo="missing")
: extracts a factor identifying all readings to a particular dive phase. This accesses thedive.phases
slot ofTDRcalibrate
objects, which is a factor.- getDPhaseLab
signature(x="TDRcalibrate", diveNo="numeric")
: as the method for missingy
, but selects data from a particular dive number to extract.- getDiveModel
signature(x="TDRcalibrate", diveNo="missing")
: extracts a list with all dive phase models. This accesses the dive.models slot ofTDRcalibrate
objects.- getDiveModel
signature(x="TDRcalibrate", diveNo="numeric")
: as the method for missingdiveNo
, but selects data from a particular dive number to extract.- getDiveDeriv
signature(x="TDRcalibrate")
: extracts the derivative (list) of the dive model (smoothing spline) from the dive.models slot ofTDRcalibrate
objects for one or all phases of a dive.- getDiveDeriv
signature(x="diveModel")
: as the method forTDRcalibrate
, but selects data from one or all phases of a dive.- getGAct
signature(x="TDRcalibrate", y="missing")
: this accesses thegross.activity
slot ofTDRcalibrate
objects, which is a named list. It extracts elements that divide the data into major wet and dry activities.- getGAct
signature(x="TDRcalibrate", y="character")
: as the method for missingy
, but extracts particular elements.- getTDR
signature(x="TDRcalibrate")
: this accesses the tdr slot ofTDRcalibrate
objects, which is aTDR
object.- getSpeedCoef
signature(x="TDRcalibrate")
: this accesses thespeed.calib.coefs
slot ofTDRcalibrate
objects; the speed calibration coefficients.
Author(s)
Sebastian P. Luque spluque@gmail.com
See Also
diveModel
, plotDiveModel
,
plotTDR
.
Examples
## Too long for checks
## Continuing the Example from '?calibrateDepth':
utils::example("calibrateDepth", package="diveMove",
ask=FALSE, echo=FALSE, , run.donttest=TRUE)
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))
}