rescale: Re-range some numbers to stretch them so that they fit a...

View source: R/general.R

rescaleR Documentation

Re-range some numbers to stretch them so that they fit a scale from a to b

Description

Re-range some numbers to stretch them so that they fit a scale from a to b

Usage

rescale(x, a = 0, b = 1, na.rm = T)

Arguments

x

A numerical vector

a

New minimum for the scale (numeric)

b

New maximum for the scale (numeric)

na.rm

Whether to remove NAs or not (default = TRUE)

Value

A stretched version of x that goes from a to b

Examples

rescale(1:10, 1, 100)

dmarginean/aqua documentation built on March 16, 2024, 1:03 a.m.