R/scale_variable.R

Defines functions scale_01

Documented in scale_01

#' Scale a vector into the 0-1 scale
#'
#' @param x a vector
#' 
scale_01 <- function(x){
  tryCatch({
  (x-min(x))/(max(x)-min(x))
  }, error=function(e){cat("ERROR :", conditionMessage(e), "\n")})
  }
RayKYang/regrrr documentation built on Aug. 16, 2021, 3:24 p.m.