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")})
  }

Try the regrrr package in your browser

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

regrrr documentation built on Aug. 13, 2021, 5:07 p.m.