R/normalize.R

Defines functions normalize

#' @title normalize
#' @description normalizes a variable, scaling it to range from 0 to 1
#' @return list
#' @author E. F. Haghish
#' @keywords Internal
#' @noRd

normalize <- function(x){
  return(x-min(x, na.rm = TRUE))/(max(x, na.rm = TRUE)-min(x, na.rm = TRUE))
}

Try the mlim package in your browser

Any scripts or data that you put into this service are public.

mlim documentation built on Dec. 28, 2022, 2:33 a.m.