R/normalize.R

Defines functions normalize

Documented in normalize

#' @title normalize
#' @description Normalize a given variable.
#' @param m variable to be normalized in the interval [0,1]
#'
#' @export
#' @author Deisy Morselli Gysi <deisy at bioinf.uni-leipzig.de>
#' @examples
#' Z = runif(10,-10,10)
#' normalize(Z)
normalize<-function(m){
  if(length(m)>1){
    m =  (m - min(m))/(max(m)-min(m))
  }
  else{ m = 1}
}

Try the CoDiNA package in your browser

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

CoDiNA documentation built on May 1, 2019, 7:58 p.m.