lin_rescale: Linear rescaling

View source: R/lin_rescale.R

lin_rescaleR Documentation

Linear rescaling

Description

Rescale numeric values from 0 to 1 to a specified interval.

Usage

lin_rescale(x, left, right)

Arguments

x

A numeric vector.

left, right

The lower and upper boundaries for rescaled interval.

Details

Values smaller than 0 or larger than 1 are rescaled to values linearly extrapolated from the specified interval.

Value

A vector with the same length as x.

Examples

lin_rescale(0.4, left = 100, right = 200)
lin_rescale(c(-2,0.3,0.6,10), left = -10, right = 10)


wyppeter/bbum documentation built on Oct. 3, 2023, 3:29 p.m.