lin_map: lin_map

View source: R/DexiUtils.R

lin_mapR Documentation

lin_map

Description

Map value x linearly from interval ⁠[imin:imax]⁠ to ⁠[omax:omax]⁠.

Usage

lin_map(x, imin, imax, omin = 0, omax = 1)

Arguments

x

numeric(). Value(s) to be mapped.

imin

numeric(). Lower bound of the input range.

imax

numeric(). Upper bound of the input range.

omin

numeric(). Lower bound of the output range.

omax

numeric(). Upper bound of the output range.

Value

numeric(). Mapped value(s).

Examples

lin_map(2, 1, 3) # 0.5

DEXiR documentation built on Sept. 30, 2024, 9:39 a.m.