calculate_proximity_weight: Calculate the Weights for Linear Interpolation Between Two...

View source: R/Spatial utilities.R

calculate_proximity_weightR Documentation

Calculate the Weights for Linear Interpolation Between Two Depths

Description

This function calculates the distance between a shallower and deeper depth to a target depth. These values are then swapped so they can be used in a weighted average to linearly interpolate to the target depth.

Usage

calculate_proximity_weight(depths, target)

Arguments

depths

A numeric vector of a shallower and deeper depth.

target

An intermediate depth we would like to interpolate to.

Value

A vector of weights to match the vector of depths.

See Also

Other NEMO-MEDUSA spatial tools: calculate_depth_share(), netcdf_scheme_helpers, scheme_column(), scheme_interp_slice(), scheme_strathE2E(), stratify(), voronoi_grid(), xyindex_to_nindex()

Examples

calculate_proximity_weight(c(0, 100), target = 30)

calculate_proximity_weight(c(0, 100), target = 50)

calculate_proximity_weight(c(0, 100), target = 80)

Jack-H-Laverick/nemomedusR documentation built on Dec. 12, 2022, 5:21 a.m.