Learn R Programming

scuba (version 1.8-0)

depths.dive: Depths at each waypoint of a dive

Description

Extracts, or alters, the depth at each waypoint during a dive.

Usage

depths.dive(d) depths.dive(d) <- value

Arguments

d
A dive (object of class "dive").
value
A numeric vector containing depths in metres.

Value

depths.dive returns a numeric vector containing the depths at each waypoint, in metres.

Details

An object of class "dive" represents a scuba dive profile. It is created by the function dive. A dive is defined as a series of waypoints occurring at specified depths and times. The depth at each waypoint is returned by depths.dive. The assignment depths.dive(d) <- value alters these depths, provided the new vector value has the same length as the old one.

See Also

times.dive, durations.dive, dive.

Examples

Run this code
   d <- dive(c(30,20), c(5,5))
   d
   depths.dive(d)
   # what if we had dived to 35 metres?
   depths.dive(d)[2:3] <- 35
   d

Run the code above in your browser using DataLab