minmax_scaling: Compute the min-max scaling

Description Usage Arguments Value Author(s) Examples

Description

minmax_scaling normalizes a given vector using the the min-max scaling method. More formally:

scaled = \frac{data -x_{min}}{x_{max} - x_{min}} \times (f_{max} - f_{min}) + f_{min}

Usage

1
minmax_scaling(data, xmin = NULL, xmax = NULL, fmin = 0, fmax = 1)

Arguments

data

Vector with numeric data to be scaled.

xmin

Optional minimum value, otherwise min(data) will be used.

xmax

Optional maximum value, otherwise max(data) will be used.

fmin

Optional minimum range value, default is 0.

fmax

Optional maximum range value, default is 1.

Value

The scaled data in the given range, default is between (0, 1). If xmin = xmax the input vector data is returned.

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

Examples

1
2
data <- c(-20, 0, 15, 20)
scaled <- minmax_scaling(data)

andreaskapou/processHTS documentation built on May 12, 2019, 3:33 a.m.