Skip to contents

This function rescales a vector to values between 0 and 1.

Usage

normalize_data(vec)

Arguments

vec

A numerical vector to normalize.

Value

A vector of doubles, the normalized values of the input vector.

Author

Marina Papadopoulou m.papadopoulou.rug@gmail.com

Examples

d <- rnorm(20, mean = 10, sd = 1)
normalize_data(d)
#>  [1] 0.2169732 0.3581060 0.0000000 0.6955193 1.0000000 0.8711250 0.4630068
#>  [8] 0.6298479 0.7588366 0.3621958 0.5680680 0.4490657 0.9603857 0.6298207
#> [15] 0.4394363 0.6628702 0.4486764 0.8632450 0.6007233 0.2821786