nmfkc.normalize: Normalize a matrix to the range [0,1]

View source: R/nmfkc.R

nmfkc.normalizeR Documentation

Normalize a matrix to the range [0,1]

Description

nmfkc.normalize rescales the values of a matrix to lie between 0 and 1 using the column-wise minimum and maximum values of a reference matrix.

Usage

nmfkc.normalize(x, ref = x)

Arguments

x

A numeric matrix (or vector) to be normalized.

ref

A reference matrix from which the column-wise minima and maxima are taken. Default is x.

Value

A matrix of the same dimensions as x, with each column rescaled to the [0,1] range.

See Also

nmfkc.denormalize

Examples

# Example.
x <- nmfkc.normalize(iris[,-5])
apply(x,2,range)

nmfkc documentation built on July 14, 2026, 1:07 a.m.