Skip to contents

Scales numeric data to the [0, 1] range using min-max normalization, or re-transforms normalized data back to its original scale. The behavior depends on the specified direction.

Usage

norm_minmax(x, min, max, direction = "RT")

Arguments

x

A numeric vector, matrix, or array to be scaled or re-transformed.

min

The minimum value used for scaling. Required for both directions, but typically set to min(x) when direction = "RT".

max

The maximum value used for scaling. Required for both directions, but typically set to max(x) when direction = "RT".

direction

A character string indicating the direction of transformation: "RT" (real to transformed) for normalization, or "TR" (transformed to real) for re-scaling. Default is "RT".

Value

A numeric object of the same shape as x, either normalized or