View source: R/depth_from_known.R
depth_from_known | R Documentation |
The depth of Sigma layers can be calculated from the depth of the seabed below mean sea level (in a given location), the tidal elevation (at a given time and in a given location) and a vector of constants which adjusts for the relative position of each layer. If these values are known, depth_from_known
can be implemented to calculate the depth of Sigma layers. If these values are unknown, the function depth_from_unknown
should be used instead: this function first computes the appropriate values for specified times/locations and then uses these values to calculate depths.
depth_from_known(siglev, h, el)
siglev |
A number or numeric vector of siglev values. |
h |
A number or numeric vector of depth below mean sea level. |
el |
A number of numeric vector of tidal elevation values. |
The function returns a number/numeric vector of Sigma layer depths calculated from user inputs.
Edward Lavender
#### Examples depth_from_known(dat_siglev$siglev[1:10], dat_h$h[1], el = 0) depth_from_known(dat_siglev$siglev[10], dat_h$h[1:10], el = 0) depth_from_known(dat_siglev$siglev[1:10], dat_h$h[1:10], el = 1:10) # Be careful with how arguments are recyled: the function may need to be implemented using apply() # ... in more complex cases, like here: ## Not run: depth_from_known(dat_siglev$siglev[1:10], dat_h$h[1:3], el = 1:3) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.