interp_layer | R Documentation |
This function linearly interpolates the layer number for an observation of a specified depth, depending on the depths of the nearest layers (see Examples). This approach is used in depth_from_unknown
to define fractional layer numbers.
interp_layer(x, l1, l2, b1, b2)
x |
A number which specifies the depth of the observation. |
l1 |
A number which specifies the layer ID of the nearest layer. |
l2 |
A number which specifies the layer ID of the other surrounding layer. |
b1 |
A number which specifies the depth of the first layer. |
b2 |
A number which specifies the depth of the second layer. |
The function returns a (fractional) layer number for an observation that lies between two layers.
Edward Lavender
#### Example (1): Interpolate fractional layer numbers # Imagine we have made an observation at 22 m deep. To compare this observation to # ... FVCOM predictions we might want to define the layer number of that observation. # Imagine we know that the observation lies between layers 2 and 3, which are 21 and 33 m deep # ... respectively. We can interpolate the layer number of our observation between layers 2 and # ... 3: interp_layer(22, 2, 3, 21, 32)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.