range01: Convert Vector to 0-1 Range

View source: R/Transformations.R View source: R/Scale.R

range01R Documentation

Convert Vector to 0-1 Range

Description

This function converts a numeric vector to a range of 0 to 1 by linearly scaling the values between the minimum and maximum of the input vector.

Scales the range of input to be between 0 and 1

Usage

range01(x, MaxN = NULL, MinN = NULL)

range01(x, MaxN = NULL, MinN = NULL)

Arguments

x

a numerical vector

MaxN

set Max value; NULL default find max(x)

MinN

set Min value; NULL default find min(x)

Value

Numeric vector scaled to range of 0 to 1.

A numeric vector

Examples

x <- c(2, 5, 9, 11, 14)
range01(x)

eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.