Learn R Programming

gen5helper (version 1.0.1)

normalize: Scale a vector to 0-1 by min and max

Description

Scale a vector to 0-1 by min and max

Usage

normalize(x, na.rm = TRUE)

Arguments

x

numeric

na.rm

bool whether to remove NA values.

Value

a normalized vector

Examples

Run this code
# NOT RUN {
normalize(0:10)
normalize(c(1, 100, NA, 10), na.rm = TRUE)
# }

Run the code above in your browser using DataLab