R/minmax.R

Defines functions minmax

Documented in minmax

#' Min-Max scaling
#'
#' @param x a numeric vector
#'
#' @description function for scaling a numeric vector to between 0 and 1
#'
#' @return a vector
#'
#' @export
#'
#' @examples
#' x <- rnorm(20)
#' minmax(x)
minmax <- function(x) {
  (x - min(x))/(max(x) - min(x))
}
jasongraf1/VADIS documentation built on July 19, 2023, 10:26 p.m.