scale_norm function

Scale variable into normal range 0, 1

Scale variable into normal range 0, 1

Perform calculation: (x - min(x)) / (max(x) - min(x))

scale_norm(x, range = NULL)

Arguments

  • x: numeric vector
  • range: numeric vector additional values for shrinking distribution of values within the 0-1 space, without affecting limits of x

Returns

numeric vector

Examples

scale_norm(x = c(-1, 4, 10, 182)) # lower bound extended beyond -1 # upper bound still range of data scale_norm(x = c(-1, 4, 10, 182), range = c(-100, 100))
  • Maintainer: Hugh Chipman
  • License: GPL-2
  • Last published: 2025-04-12

Useful links