Skip to contents

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.

Usage

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

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

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

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

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

# S3 method for class '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