Rescale vectors or variables within data frames. This can be useful for comparing vectors that are on different scales, for example in parallel plots or heatmaps.

rescale(x, range, domain = NULL, ...)

# S3 method for data.frame
rescale(x, range = c(0, 1), domain = NULL, ...)

# S3 method for factor
rescale(x, range, domain = NULL, ...)

# S3 method for numeric
rescale(x, range = c(0, 1), domain = NULL, ...)

# S3 method for default
rescale(x, range = c(0, 1), domain = NULL, ...)

# S3 method for character
rescale(x, range = c(0, 1), domain = NULL, ...)

Arguments

x

an R object to rescale

range

a numeric vector of length 2

domain

a numeric vector of length 2 or NULL

...

additional arguments