rescale_variable: Rescale a Numeric Vector

View source: R/rescale.R

rescale_variableR Documentation

Rescale a Numeric Vector

Description

Rescales a given numeric vector to be bounded between two specified values.

Usage

rescale_variable(x, a, b)

Arguments

x

A numeric vector.

a

The lower bound of the new scale.

b

The upper bound of the new scale.

Value

A numeric vector rescaled to be within a, b.

Examples

data <- c(1, 2, 3, 4, 5)
rescale_variable(data, 0, 10)

barryquinn1/tsfe documentation built on Jan. 23, 2025, 2:09 a.m.