Skip to contents

This function applies a reverse operation of normalization for a numeric vector x based on the scale factors derived from an original vector orig_x. It effectively attempts to map the values in x back to their original scale by applying the inverse operations of scaling and translation based on the minimum and maximum values found in orig_x. The process involves scaling x by the maximum value (after subtracting the minimum value) of orig_x and then adding the minimum value of orig_x to each element.

Usage

rescale(x, orig_x)

Arguments

x

A numeric vector that needs to be rescaled to its original range.

orig_x

The original numeric vector from which the scale factors are derived.

Value

A numeric vector with values rescaled to their original range based on the scale factors from orig_x.

Examples

orig_x <- rnorm(100)
rescaled_x <- rescale(norm01(orig_x), orig_x)