Skip to contents

Data Transformation: Global Rescaling of to a New Range

Usage

f_rescale_global(
  x = NULL,
  new_min = 0,
  new_max = 1,
  old_min = NULL,
  old_max = NULL,
  .global,
  ...
)

Arguments

x

(required, zoo object) Time Series. Default: NULL

new_min

(optional, numeric) New minimum value. Default: 0

new_max

(optional_numeric) New maximum value. Default: 1

old_min

(optional, numeric) Old minimum value. Default: NULL

old_max

(optional_numeric) Old maximum value. Default: NULL

.global

(optional, logical) Used to trigger global scaling within tsl_transform().

...

(optional, additional arguments) Ignored in this function.

Value

zoo object

Examples

x <- zoo_simulate(cols = 2)

y <- f_rescale_global(
  x = x,
  new_min = 0,
  new_max = 100
)

if(interactive()){
  zoo_plot(x)
  zoo_plot(y)
}