reScale function

Rescale a numeric vector to a specified minimum and maximum

Rescale a numeric vector to a specified minimum and maximum

Rescale a numeric vector to a specified minimum and maximum.

reScale(x, type = "simple", to = c(0, 1), na.rm = TRUE)

Arguments

  • x: numeric vector to smooth.
  • type: what kind of rescaling to perform. Current options are 'simple' (default) and 'normal' which produces a z-score and 'custom' for which the 'to' argument must be specified.
  • to: numeric vector of length 2 specifying the minimum and maximum value to perform a linear rescale between (default is 0 and 1)
  • na.rm: Set to TRUE,this removes NAs before rescaling.

Returns

A numeric vector of rescaled values.

Examples

reScale(15:200)
  • Maintainer: Enrico Crema
  • License: GPL (>= 2)
  • Last published: 2023-08-24