normalise: Rescale values to the [0,1] range

Description Usage Arguments Value Examples

Description

A helper function – normalise/rescale values so that they fit into a range from 0 to 1. (The minimum value becomes 0 and the maximum value becomes 1).

Usage

1
normalise(numvec)

Arguments

numvec

A numeric vector

Value

A numeric vector with values in the range [0,1].

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- seq(from=-3.7, to=6.5, by=1.36)
y <- normalise(x)
data.frame(x,y)
#     x          y
# -3.70  0.0000000
# -2.34  0.1428571
# -0.98  0.2857143
#  0.38  0.4285714
#  1.74  0.5714286
#  3.10  0.7142857
#  4.46  0.8571429
#  5.82  1.0000000

alekrutkowski/wiod.diagrammer documentation built on May 20, 2019, 8:47 a.m.