% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_scalings.R
\name{minmax}
\alias{minmax}
\title{Min-Max Scaling to \eqn{[0,1]}}
\usage{
minmax(x, na.rm = FALSE)
}
\arguments{
\item{x}{Numeric vector. Input values to be scaled.}

\item{na.rm}{Logical; if \code{TRUE}, ignore \code{NA}s when computing the range.}
}
\value{
A numeric vector of the same length as \code{x}, scaled to the range \eqn{[0,1]}.
}
\description{
Scales a numeric vector to the range \eqn{[0,1]} using min-max normalization.
This is a special case of \code{\link{scRange}}.
}
\details{
The scaled values are computed as:
\deqn{x_{scaled} = \frac{x - \min(x)}{\max(x) - \min(x)}}

Equivalent to \code{scRange(x, ra = c(0, 1))}.
}
\examples{
x <- rnorm(20)
plot(x, type = 'l'); abline(h = range(x), lty = 2)
points(minmax(x), type = 'l', col = 'blue')
abline(h = c(0, 1), col = 'blue', lty = 2)

}
\seealso{
\code{\link[=scRange]{scRange()}} for flexible output ranges.
}
