Learn R Programming

scuba (version 1.1-9)

dive: Define a Dive Profile

Description

Define a dive profile.

Usage

dive(...)

Arguments

...
Any number of arguments, specifying a sequence of events that make up the dive. The arguments may specify depths, time spent at each depth, ascent or descent rates, and gas switches. See Details.

Value

  • An object of class "dive" describing the dive profile and the breathing gases used.

Warnings

Not suitable for representing altitude dives. Not applicable to gas mixtures other than air and nitrox (oxygen-nitrogen mixtures).

Details

This function creates an object of class "dive" which represents a scuba dive. The dive profile is assumed to be piecewise linear, that is, the graph of depth against time is a broken straight line. Dives are assumed to start and finish at the surface.

The arguments ... specify a succession of events that make up the dive. Each argument can be [object Object],[object Object],[object Object],[object Object],[object Object] Dives are assumed to start and finish at the surface.

Initially the descent rate is set to 30 metres per minute, the descent rate is 18 metres per minute, and the breathing gas is air. These settings may be changed during the dive by the ... arguments.

Once an object of class "dive" has been created, it can be plotted and printed (using plot.dive and print.dive). The nitrogen saturation can be computed using haldane and the cumulative oxygen toxicity using oxtox.

See Also

nitrox, ascent, descent, haldane, plot.dive

Examples

Run this code
# Dive to 25 m for 20 min followed by safety stop at 5 metres for 3 min
  d <- dive(c(25,20),c(5,3))
  plot(d)

  # Bounce dive to 20 metres
  d <- dive(20)

  # GAS SWITCHING
  # Dive to 18 m for 30 min on air,
  # switch to Nitrox 36, ascend to 5 metres, safety stop
  d <- dive(c(18, 30), nitrox(0.36), c(5,3))
  # Same as above, but ascend to 5 m on air, then switch gas
  d <- dive(c(18, 30), 5, nitrox(0.36), c(5,3))

  # ASCENT RATES
  # Ascent rate 18 m/min below 9 metres, 6m/min above 9 metres
  d <- dive(c(30, 12), ascent(18), 9, ascent(6), c(5,3))

  # UPLOADED DIVE PROFILE
  data(baron)
  pro <- baron[, 1:2]
  d <- dive(pro)

Run the code above in your browser using DataLab