Dive tables are a series of ifelse statements. For example:

The DCIEM package writes a series of simple ifelse statments into functions:

Repetitive Groups:

The get_RG() function calculate repetitive groups:

library("DCIEM")

get_RG(depth=12, bottomtime = 18)
## [1] "A"
get_RG(30, 60)
## [1] "WARNING: BEYOND NO DECO LIMITS, CONSULT DCIEM TABLE"

get_RG() also works with nitrox calculations by specifying the mix and calculating the Equivalent Air Depth (see EAD() below for function details:

get_RG(depth=12, bottomtime=58) # default air settings to 21 Nitrox
## [1] "D"
get_RG(depth=12, bottomtime=58, EANx=36) 
## [1] "C"

Repetitive Factors

To calculate the Repetitive Factor (RF) after a surface interval use get_RF()

get_RF(RG = "A", surfaceinterval = 50) # surfaceinterval in minutes
## [1] 1.2
get_RF("C", 16)
## [1] 1.6

Equivalent Air Depth

To calculate Equivalent Air Depth outside of get_RG() use the EAD() function where:

EAD = (depth + 10) × (fraction of N2 / 0.79) − 10

EAD(EANx=36, depth=12)
## [1] 7.8
EAD(32, 17)
## [1] 13.2