R/max_min_scale.R

Defines functions max_min_scale

Documented in max_min_scale

#' @title max_min_scale
#'
#' @description a function for max-min normalization for
#' network propagation score.
#'
#' @param x a numeric vector
#'
#' @returns a numeric vector
#' @export
#'
#' @examples
#' x <- rnorm(10)
#' scale_vec <- max_min_scale(x = x)
max_min_scale <- function(x){
  scale_vec <- (x-min(x))/(max(x)-min(x))
  return(scale_vec)
}
sankaranlab/SCAVENGE documentation built on March 2, 2023, 2:17 a.m.