get_depth: Get the depth at index i

Description Usage Arguments Value Examples

View source: R/get_depth.R

Description

Simply extracts element i of depth but includes failsafes for missing depth or missing i. Used by other functions.

Usage

1

Arguments

i

element of depth to extract.

depth

vector of depths at which x is measured.

Value

If both i and depth are provided, return depth[i]. If i is NULL/empty, return NA. If depth is NULL return i.

Examples

1
2
3
4
castr:::get_depth(2, c(34, 35, 36))
castr:::get_depth(2, NULL)
castr:::get_depth(NULL, c(34, 35, 36))
castr:::get_depth(c(), c(34, 35, 36))

jiho/castr documentation built on April 5, 2020, 2:12 p.m.