nca_normalize: Normalizes numeric data

nca_util_normalizeR Documentation

Normalizes numeric data

Description

(Min-max) Normalize the columns of the data

Usage

nca_util_normalize(data, scale = NULL, min_max = NULL)

Arguments

data

Input dataframe or matrix.

scale

Set(s) of output Min-Max values.

min_max

Set(s) of (theoretical) Min-Max values.

Details

scale
If scale is NULL (default), all columns will be normalized between 0 and 1.
Use c(0, 100) to normalize between 0 and 100.
Replicate for each column for different scale, e.g. c(0, 1, 0, 1, 0, 100).
Use NA in the min-max pair if a column does not need to be normalized.

Examples

# Normalize the data between 0 and 1
data(nca.example)
data.normalized <- nca_util_normalize(nca.example)
# Equivalent to this
data.normalized <- nca_util_normalize(nca.example, c(0, 1))

# Normalize the data between 0 and 100
data.normalized <- nca_util_normalize(nca.example, c(0, 100))

# Normalize each column with different values
data.normalized <- nca_util_normalize(nca.example, c(0, 1, 0, 10, 0, 100))

# Use NA if a column doesn't need to be normalized
data.normalized <- nca_util_normalize(nca.example, c(0, 1, NA, NA, 0, 100))

# It is also possible to use a theoretic range for the normalization
data.normalized <- nca_util_normalize(nca.example, min_max = c(0, 100, 0, 150, 0, 300))

NCA documentation built on March 20, 2026, 5:08 p.m.