Learn R Programming

shapley (version 0.6.0)

normalize: Normalize a vector based on specified minimum and maximum values

Description

This function normalizes a vector based on specified minimum and maximum values. If the minimum and maximum values are not specified, the function will use the minimum and maximum values of the vector (ignoring missing values).

Usage

normalize(x, min = NULL, max = NULL)

Value

A numeric vector of the same length as x

Arguments

x

numeric vector

min

minimum value

max

maximum value

Author

E. F. Haghish

Examples

Run this code
if (FALSE) {
# the function is not exported
normalize(c(0, 5, 10))
normalize(c(1, 1, 1))
normalize(c(NA, 2, 3))
}

Run the code above in your browser using DataLab