Learn R Programming

fdars (version 0.3.3)

scale_minmax: Min-Max scaling for functional data

Description

Scales each curve to the range \([0, 1]\) (or custom range). This preserves the shape while normalizing the range.

Usage

scale_minmax(fdataobj, min = 0, max = 1)

# S3 method for fdata scale_minmax(fdataobj, min = 0, max = 1)

# S3 method for irregFdata scale_minmax(fdataobj, min = 0, max = 1)

Value

A scaled 'fdata' object where each curve is in the specified range.

Arguments

fdataobj

An object of class 'fdata'.

min

Target minimum value (default 0).

max

Target maximum value (default 1).

Examples

Run this code
fd <- fdata(matrix(rnorm(100) * 10 + 50, 10, 10), argvals = seq(0, 1, length.out = 10))
fd_scaled <- scale_minmax(fd)
# Check: each curve now in [0, 1]
apply(fd_scaled$data, 1, range)

Run the code above in your browser using DataLab