Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rerange

Linear transformation of data


Description

The function performs a linear transformation of the data, such that afterwards range(data)=c(theMin,theMax).

Usage

rerange(data, min.goal = 0, max.goal = 1, min.data =
    min(data), max.data = max(data), center = NA)

Arguments

data

vector with the data to transform

min.goal

new minimum value

max.goal

new maximum value

min.data

old minimum value

max.data

old maximum value

center

which old value should become the new center (max.goal + min.goal) / 2)

Value

vector with the transformed data

Author(s)

Dominik Reusser

Examples

klaR:::rerange(data=1:20)
   klaR:::rerange(data=1:30, center=5)

klaR

Classification and Visualization

v0.6-15
GPL-2 | GPL-3
Authors
Christian Roever, Nils Raabe, Karsten Luebke, Uwe Ligges, Gero Szepannek, Marc Zentgraf, David Meyer
Initial release
2020-02-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.