R/linear_map.R

#' Linear map
#'
#' @param x numeric vector
#' @param y.min min value of the new distribution
#' @param y.max max value of the new distribution
#' @export

linear_map <- function (x, y.min, y.max){
  m <- ((y.max - y.min)/(max(x) - min(x)))
  c <- y.max - m * max(x)
  y <- m * x + c
  return(y)
}
emosca-cnr/dmfind002 documentation built on May 16, 2024, 10:44 p.m.