rerange: Linear transformation of data

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
2
3
rerange(data, min.goal = 0, max.goal = 1, min.data =
                 min(data, na.rm=na.rm), max.data = max(data, na.rm=na.rm), 
                 center = NA, na.rm=FALSE)

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 )

na.rm

boolean, passed to min and max

Value

vector with the transformed data

Author(s)

Dominik Reusser

Examples

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

fast documentation built on May 2, 2019, 5:56 a.m.